Apologies for having to ask a question like this, self taught powershell user here. Having an issue where I cannot seem to get the value I am after from a JSON return on a GET Invoke-RestMethod.
I am trying to pull JIRA ticket data so I can check to see if a custom field has been updated with a value. I have tried calling the custom field directly in the response however due to way the response is formatted it will only return the column of data and therefore I am unable to use this reponse in my code.
My code is as follows:
$response = Invoke-RestMethod "https://jira-ceg.atlassian.net/rest/servicedeskapi/request/$JIRATICKET" -Method 'GET' -Headers $headers
$tester = $response.requestFieldValues
$tester
The response I get from JIRA is the following:
fieldId label value
------- ----- -----
summary Summary STAFF-NEW - XXXX- NAME
customfield_10108 iTrent Information Employee ID: XXXX...
customfield_10086 Checklist Text --- ERROR - No Role Entitlement Found - Contact Service Admin
description Description A new employee has joined. Please process with the data above.
customfield_10191 New AD Address XXXX@XXXXX.com
I want to capture the value of the field customfield_10191, the field could sometimes be blank too, which I will test later in the script. Any idea how I could do this?
Thanks in advance!