jiraIssueFields add-on - how to read values from 3rd party API

I’m trying to develop an AC add-on that adds a new field to all JIRA issues. The field is a single_select and I want to populate the values by invoking some 3rd party API on the fly. Is there a way to do this, or do jiraIssueFields only work with data that’s stored in JIRA?

I am new to JIRA development, and the way I’m starting is by looking at the JIRA issue field demo project and extending/modifying it: Bitbucket

But even as I try to run that demo project as is, it doesn’t really work. Let lets me define the field values through a REST table, and the values do get saved to that demo’s DB, but when I open a new-issue form (or edit an existing one) it never fetches the possible field values from the add-on’s server.

I would really appreciate a pointer here.

1 Like

Hey Assaf,

That’s correct - jiraIssueFields only work with data that’s stored in JIRA. This gives the field greater reliability and performance (doesn’t depend on the add-on availability for issues to be created - which would compound with JIRA’s own availability). I’m not sure how up-to-date the demo is, but it should be POSTing data to JIRA’s field API (https://docs.atlassian.com/jira/REST/cloud/#api/2/field/{fieldKey}/option) - see routes/sync.js

Hope this helps - let me know if you need more details !

1 Like

Thanks, gjoseph. That’s very helpful.

So, any idea how I could go about adding a field whose values are obtained dynamically from a 3rd party? Perhaps not using jiraIssueFields but something else?

To be more accurate, if the field has no value, the available options should be obtained dynamically via REST, but the chosen value could then be saved in JIRA’s own data store.

You’ll probably want to to take a look at using a dialog entry to bring up a custom dialog where the user can select the selection. Then your add-on stores the data in JIRA using https://developer.atlassian.com/static/connect/docs/latest/modules/jira/entity-property.html . These are then available for searching etc. You can then render these in issue as well using the web-panel module (and have a button to bring up the dialog using AP.dialog ).

1 Like

@assaf I have been looking to do something quite similar. Have you managed to resolve this?