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

Fix Provided: Get-JiraUser function inside Invoke-JiraIssueTransition function can return an array of users #349

Closed
mirrorgleam opened this issue Apr 25, 2019 · 10 comments · Fixed by #351

Comments

@mirrorgleam
Copy link
Contributor

Description

If JIRA has usernames such as "jsmith", "jsmithy", "jsmith1", "jsmithson" and you are trying to assign the ticket to "jsmith" it will fail because the assignee field needs a string but this function is returning an array of strings.

Steps To Reproduce

$userDetails = Get-JiraUser -UserName "jsmith" -Credential $jiraCredentials -Exact
Invoke-JiraIssueTransition -Issue "TCKT-1234" -Credential $jiraCredentials -Transition 1 -Assignee $userDetails 

Expected behavior

Ticket will be assigned to the user in $userDetails

Possible Solution

My Fix: Modified JiraPS.psm1
line 2964: if ($assigneeObj = Get-JiraUser -InputObject $Assignee -Credential $Credentials) {
change: added -Exact flag to Get-JiraUser function

In https://github.com/AtlassianPS/JiraPS/blob/master/JiraPS/Public/Invoke-JiraIssueTransition.ps1
line 112

@alexsuslin
Copy link
Contributor

Could you please submit a pull request to this issue?

@mirrorgleam
Copy link
Contributor Author

I'm not familiar with pull requests but I'll look it up and try to figure out what I need to do.

@lipkau
Copy link
Member

lipkau commented Apr 26, 2019

Thank you, @mirrorgleam .
Here are the instructions on how to submit a Pull Request:
https://atlassianps.org/docs/Contributing/#how-to-submit-code-changes

of course I would gladly support you with it :-)

@mirrorgleam
Copy link
Contributor Author

Just submitted it. I hope it's up to standards.
I just submitted one for the Invoke-JiraIssueTransition, should I also submit one for the JiraPS.psm1 file?

@mirrorgleam
Copy link
Contributor Author

And on further review I now see that isn't necessary.
Clever coding on that file. I've learned something new about PS.
Also, thanks for building this module. It's been extremely helpful these past few months.

@lipkau
Copy link
Member

lipkau commented Apr 26, 2019

I do not see your PR yet.
https://github.com/AtlassianPS/JiraPS/pulls

can you post the link to the PR you created?

@lipkau
Copy link
Member

lipkau commented Apr 26, 2019

@mirrorgleam
Copy link
Contributor Author

This is what I get when I click that.
image

@mirrorgleam
Copy link
Contributor Author

AH THINK I FOUND IT :D

@mirrorgleam
Copy link
Contributor Author

It looks like it's in your pull requests now

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

Successfully merging a pull request may close this issue.

3 participants