I have a PowerShell script that makes a POST request to a Jira server. The request body contains JQL and Fields I want returned.
The URL The request is being made to:
"https://*************/rest/api/2/search"
The JQL Query :
"project = vippd and issuetype = story and duedate < 30d"
The request body:
$requestBody = @{
"jql" = $jqlQuery
"fields" = @(
"*all"
)}
There is a lot to the script but that has to do with formatting my output but that shouldn't be important for the scope of this question.
When looking at the raw response with a little formatting done to separate each field. I notice that there are a lot of fields that don't have any data in them, this wouldn't be alarming if they were actually empty but plenty of those fields have data if I check the issue in my browser.
Would anyone know why those fields aren't returning their data and how I can make it so that they do?
Well, first, check the values in
/rest/api/2/issue/<issueKeyOrId>?fields=customfield_xxx,description,etc
Since what you describe should not be the case, I think some examples would be useful to understand the context a bit better. Some fields may display values dynamically without an actual "storage" representation, so to speak, so I guess knowing what kind of fields you're trying to get might be one factor.
Here's an output from the /rest/api/2/issue API.
After looking at all the fields used on our Jira server I noticed that we have 4 possible custom fields that could be the information I'm looking for. Developer, Developers, Developer(s) and Assigned Developer. I don't have much control over that.
What I've noticed after investigating is that The Developers custom field is the only one that will ever return anything and that is if only one Developer is present in that field.
All the other fields remain empty no matter what issue I try.
Here's the script that I'm using to call the API and get that information.
The developers Field has a field type of Multi User picker
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After more investigation I was able to get the info out of the custom field.
Thank you for the push in that direction. Led me down the rabbit hole that got me what I needed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Aram Watson I am fetching the same issue. Could you tell me, how you overcame this issue? I am getting the assignee field "null", where the assignee is visible in the browser.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.