...
Sometimes JSON structures are logical and easy to use, sometimes they are not (Accessing Insight object properties), and sometimes it is something in-between
For example a recent deprecation and removal of a createmeta service in Jira 9 https://confluence.atlassian.com/jiracore/jira-9-4-rest-api-change-log-1178876796.html#Jira9.4RESTAPIchangelog-9.0 and substitution it with new endpoints returning a "slightly" different structures
...
Expand | ||
---|---|---|
|
It is now an array of "values", where each field is an independent object in the array
Now imagine we want to access the values of a "Priority" object and show them as dropdown options in ConfiForms web-service dropdown field
...
You can see the structure looks like this (we usually use https://jsonviewer.stack.hu/ to visualize that) and the priority's field values are behind the element by index 10
So the "Root to use" in the web-service will look like
Code Block |
---|
values[10].allowedValues |
If accessing it by index does not look like "your thing" - there is another way. You can do it by property value match
Here is how
Code Block |
---|
values.(fieldId=priority).allowedValues |
So, it will access the "values" array and will look for objects/elements inside it matching their field "fieldId" against the given value (priority)
Just in case if you are curious on how the complete configuration for a web-service backed dropdown field looks like (backed by Jira 9 (and cloud) new createmeta service - https://docs.atlassian.com/software/jira/docs/api/REST/9.7.1/#api/2/issue-getCreateIssueMetaProjectIssueTypes)