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

Updated Set-JiraIssue to allow for optional Summary and Description #24

Closed
wants to merge 13 commits into from
Closed

Conversation

lipkau
Copy link
Member

@lipkau lipkau commented Apr 1, 2016

I found in my projects, that often Summary and Descriptions are not mandatory fields

LiamLeane and others added 6 commits March 18, 2016 11:08
OOB ConvertFrom-Json implementation does not allow for overriding JSON
maxlength. Default is easy to exceed with large issue lists.

Change adds a ConvertFrom-Json2 function which allows override of
maxlength, sets the default to Max(int) and replaces all calls to
ConvertFrom-Json with ConvertFrom-Json2
Added an extra 2 ad the end of the function name, doh.
A couple of the other functions rely on expanded types so replicating
expanded types functionality in PS.
@replicaJunction
Copy link
Collaborator

Hi lipkau,

I can understand why Set-JiraIssue may not need Summary and Description to be mandatory, but I'm not sure I understand a use case where New-JiraIssue does not require at least a summary. If you could, would you mind running Get-JiraIssueCreateMetadata and checking to see whether Summary and Description are flagged as Required?

Also, I disagree with your change to Set-JiraConfigServer, as modifying a global variable within the scope of a module is a bad design practice. Users may not want this variable changed, and it would still need to be called each time a user opens a new PowerShell window. You can use New-JiraSession to create a persistent, authenticated session using a cookie, or you can modify the PSDefaultParameterValues variable in your PowerShell profile.

Let me know about those two fields in the create metadata, and if they're not flagged as required, we can adjust the parameter values.

Thanks!
replica

@lipkau
Copy link
Member Author

lipkau commented Apr 4, 2016

Hi replica.

  • I was mistaken with summary. I didn't find a project where it is not mandatory.
  • description is definitely not always mandatory
  • priority is -in my sample- also not mandatory, but the Set-JiraIssue fails if I don't provide it.

screenshot_20160404_085453

@lipkau
Copy link
Member Author

lipkau commented Apr 4, 2016

Regarding the credentials change.

  • I didn't mean to place it in the same PR - I forgot to create an extra branch.
  • I don't agree that setting defaultParameterValues is a bad practive, as the user can choose if he wants to use it or not (also, I got this idea from several PowerShell MVPs)

@lipkau
Copy link
Member Author

lipkau commented Apr 4, 2016

Also:
I can set up a 30 day trail JIRA server for you, if you want

Accounted for cases where a user did not supply a Labels parameter.
replicaJunction added a commit that referenced this pull request Apr 13, 2016
In response to discussion around #24, I've updated Priority to be a
non-mandatory parameter for this function.

If you attempt to create a new issue for a project and issue type where
Priority is mandatory, you'll receive an error back from JIRA just as if
you'd omitted a custom field that was mandatory.
@replicaJunction
Copy link
Collaborator

I'm having some issues with GitHub and pull requests; the updated changes are in branch pr/24 (latest commit 640b3fe). Take a look when you get a chance and see if it matches what you're looking for.

It surprises me that Priority isn't mandatory - I've never seen that before - but I made the change. Now, if you don't supply Priority in a case where it is required, JIRA will send back the same error it would if you omitted another mandatory field.

I don't mean to say that PSDefaultParameterValues is a bad practice in general, but I believe it should be a user-level customization rather than a module-level customization. In my opinion, modifying it in your profile is great, but modules shouldn't mess with your settings. That's just my opinion, though.

Regarding a JIRA trial server - that would be awesome. Would you mind if I drop you an e-mail to discuss further (with the address on your GitHub profile)?

Switching to ConvertFrom-Json2
@lipkau
Copy link
Member Author

lipkau commented Apr 13, 2016

sure. go ahead.
I am also in powershell.slack.com, if you prefer.

@lipkau lipkau closed this May 9, 2016
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

Successfully merging this pull request may close these issues.

3 participants