It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
I am looking to query a specific field in a JIRA ticket and pass the value to a variable (or output to a file).
Running a curl against a URL (see example below) gives me a large block out output in JSON format as expected:
curl -u username https://jira.abc.com/rest/api/2/search?jql=key=RLG-1234
If I use "Invoke-RestMethod" via PowerShell the output comes back in a tabular format
Invoke-RestMethod -Credential $creds -Uri https://jira.abc.com/rest/api/2/search?jql=key=RLG-1234 startAt maxResults total issues ------- ---------- ----- ------ 0 50 0 {} GetType() IsPublic IsSerial Name BaseType -------- -------- ---- -------- True False PSCustomObject System.Object
Piping the output of "Invoke-RestMethod" to "Get-member -MemberType NoteProperty | Get-Member -Name issues" does not give me anything.
How do I drill down to a specific field under "issues" so that I can access its value?
Thanks! I am able to get what I want using curl and then pipe to JQ to get specific values, but since am moving to PowerShell, I would like to know how to accomplish this using Invoke-RestMethod (or any other more appropriate way)
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreAtlas Camp is our developer event which will take place in Barcelona, Spain from the 6th -7th of September . This is a great opportunity to meet other developers and get n...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.