AtlassianPS / JiraPS

PowerShell module to interact with Atlassian JIRA
https://AtlassianPS.org/module/JiraPS
MIT License
321 stars 131 forks source link

Updating JiraPS.psm1, fixing accountId error, Assigning Jira Issue problem #471

Closed JD-LV closed 1 year ago

JD-LV commented 1 year ago

(I created a fork for this to start messing with the psm1 file) (admittedly I'm a pretty crap dev, generally no idea what I'm doing except trial and error)

Issue 1 (resolved?)

example: Line 2736: $searchResourceUri = "$server/rest/api/3/user/search?query={0}"

These modifications resolved the accountId query lookup with GDPR Strict mode. At least I'm pretty sure about the second part with the query warning. I found this by running Invoke-JiraMethod manually with the Uri as mentioned in Jira API documentation.

Issue 2 (in progress): The new issue I'm investigating past that has to do with Set-JiraIssue -Assignee

Given the GDPR Strict things, and following Atlassian's API docs on the subject https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-assignee-put

--

I'm hypothesizing we're looking to make the translation from emailAddress to accountId. Fixing Issue 1 resolved the lookup portion. I am now getting lookups on the user, pulling accountId, and I feel like I'm on the edge of the breakthrough to sending the correct PUT request in order to trigger Assignee:

Something notable-- running Get-JiraIssue by itself piped to format-list pulls nothing from Assignee. Running: (get-jiraissue -Key $key).assignee pulls the assignee information, as an object I'm told. Which is why it's not pulling by itself?

So another speculative hypothesis is if the Assignee is an object, means Assigning it must also be an object? It seems like that's happening now, runs through, but doesn't actually assign. It will unassign without fault. I get no errors on assignment attempts, just failure to assign. Other Set-JiraIssue functions are working as intended.

I did also note that the Name field seems to be blank, but DisplayName is not. I also suspect that as a problem point potentially.

JD-LV commented 1 year ago

Belay all this

I found out my company AV was freaking out about the module but was not notifying me of its failure to re-import changes.

I figured that out, cleared the block, and as is Assigning issue is functioning correctly. Proceeding to figure out how to submit my changes here.