APIs
Accessing Jira Fields
You can access the values of other fields and properties within JMCF Scripted Fields - both for the current issue and related issues - by using the APIs detailed in this section.
Note: It is not possible to access values directly within your scripts. This method, while once possible, is no longer supported. You must use the getField or getFields APIs to access field values. This includes when using getLinkedIssues, getChildIssues, and getParentIssue. To access field values of work items returned by these APIs, you must also use getField or getFields after fetching the related work items. See each page for details on how to update your scripts.
Additionally, you must always get fields using the ID or key, and not the field name or label (some Jira system fields have the same ID as their name, but this does not affect the requirement). See Determining custom field IDs, below, for more information.
The script editor
The script editor window includes standard code editing features, including syntax colorization, error highlighting, code formatting, and code completion. Additionally, the script editor will provide prompts when it detects you are implementing API calls in your code.
The editor also includes three shortcut buttons to the right side of the window:
Expand/Contract - Expand the editor to full height, or shrink it back to its original height.
Snippets - Pre-written script examples.
Help - Links to JMCF for Jira Cloud documentation, scripted field documentation, and the Appfire support portal.
Scripted Field Hints
Similar to many code editors, the scripted field editor includes syntax highlighting, error highlighting, cursor navigation, and code completion. The editor has access to all JMCF for Jira Cloud APIs and provides prompts as you type, as well as function references.
You are viewing the documentation for Jira Cloud.
Determining custom field IDs
There are several ways to determine the field ID of a custom field; the most straightforward is to check the URL of the custom field when editing its details through the Jira Custom fields screen. To find the ID of a custom field:
Log into Jira as an Administrator.
In the upper right corner of the window, click Settings ( ) and select Issues.
In the left-hand sidebar, click Custom fields.
Locate your custom field in the list; use the filter at the top of the list to search.
Click the action button at the far right ( ) and select Edit details.
Check the URL for the page that opens - the final argument of the URL is the field ID (Figure 1, right).
Append this value to “customfield_” to get the full ID of the field. For example,
customfield_10130is the field ID of Projected Due Date, shown in the figure immediately right.