Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Issue Without Priority #52

Closed
brianbunke opened this issue Oct 6, 2016 · 4 comments
Closed

Create Issue Without Priority #52

brianbunke opened this issue Oct 6, 2016 · 4 comments

Comments

@brianbunke
Copy link
Contributor

I have a project where the Priority field is hidden. I can't use New-JiraIssue to create an issue in this project, because the -Priority parameter is mandatory.

Confirmed with the following steps:

  • Set a breakpoint on line 185 of New-JiraIssue
  • Run New-JiraIssue with desired parameters
  • Prompted to enter a value for mandatory parameter Priority
  • Enter breakpoint
  • $json
    • Includes the priority
  • $hashtable.fields.Remove('priority')
  • $json = ConvertTo-Json -InputObject $hashtable -Depth 3
  • Exit breakpoint
  • Issue is created successfully

Can you think of any reason this parameter needs to remain mandatory?

@replicaJunction
Copy link
Collaborator

Hmm, I've never run into a situation where priority isn't mandatory for actually creating an issue. If you run Get-JiraIssueCreateMetadata on that project, does Priority show that it's non-mandatory as well?

If it's not actually mandatory to JIRA, then there's no reason for the parameter to be mandatory, either.

@brianbunke
Copy link
Contributor Author

Dictated by the applied field config scheme, issue type Task within project PROJ "hides" the Priority field in this instance. From memory, I'd guess Priority is required by default, but it's very easy to make it optional, and just as easy to hide if you're crazy like me.

Not that I've tested every scenario, but the assumption is that the required parameter easily applies to project & issue type combos where the field is both required and optional, and only chokes when the field isn't found.

PS> Get-JiraIssueCreateMetadata -Project PROJ -IssueType Task | Select Name,Required

Name          Required
----          --------
Assignee         False
Attachment       False
Epic Link        False
Description      False
Due Date         False
Linked Issues    False
Issue Type        True
Labels           False
Project           True
Reporter          True
Summary           True

@replicaJunction
Copy link
Collaborator

Fair enough. No reason to keep that parameter as mandatory, then.

I'll make the change as soon as I get a chance (or feel free to submit a PR for it).

@replicaJunction
Copy link
Collaborator

Merged and published to the Gallery. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants