JIRA Field Values in Read mode

Posted by Aleks Yenin

Normann P. Nielsen asked:

I would like to make a button that launches an URL for a JIRA Search, where 2 existing field values from the issue is used – and the issue is opened in read mode.

If the custom field is on the view screen, even if it is hidden behind a tab, you should be able to access the value through Javascript/jQuery. The method may depend on the exact nature of the field, but in most cases, you should be able to do something like:

1

AJS.$("#customfield_10000-val").text().trim()

The .trim() is there just because the HTML contains a lot of extra white space. If the value is not on the screen, then you can still get at it via the REST API.

This is more complicated because you would have to use an out-of-band HTTP call (“ajax”).

The REST resource would be “/rest/api/2/issue/{issueIdOrKey}”.

Check out REST for more details, just replace “latest” with JIRA’s version in the URL.