Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Options for custom field

Deleted user
August 23, 2024

Hi, I need to have a custom field, single select box, where I get the options from a different system. 

I understand how to create a custom field and manually creating the different options. 

is it possible to get the list of options from another system via an API call? 

2024-08-23_12-39-28.jpg

3 answers

0 votes
Rudy Holtkamp
Community Champion
August 23, 2024

Hi @[deleted] ,

If you are using a form in a JSM project, you can use data connections, take a look at: https://support.atlassian.com/jira-service-management-cloud/docs/create-edit-test-or-delete-data-connections-for-forms/

If you use (regular) Jira, then you need to create an automation rule, that gets the options and add them via the rest api.

The hard part is the next time your run the automation, you need to only add/disable the differences of the two lists.

 

Deleted user
August 24, 2024

Thanks, this is for regular Jira Cloud
I am looking into using ScriptRunner to call the REST api of the source application. 
As I understand it, in ScriptRunner you can call the REST api of Jira. 

So I am thinking that in the script I can call the REST api of the source to get the options I want to represent, and then call the Jira REST api to populate the custom field. 

And as you said, figure the logic when the data has changed in the source application 

0 votes
xzu
August 23, 2024

I am not sure about ScriptRunner, but I did something similar a while ago using a middleware. Here’s what I did:

  1. Get Request to the External System: I made a GET request to the external system to retrieve the options.
  2. Import Data Using Azure Function: I used an Azure Function written in Python to import the data in JSON format.
  3. Update Jira Cloud: I made a PUT request to the Jira Cloud API to update the options.

The middleware can be run on a schedule or triggered by an event.

Deleted user
August 24, 2024

Do I understand it correct that this is what you did? 2024-08-24_10-15-56.jpg

xzu
August 25, 2024

Source App --> Middleware in Azure --> Jira API

Like Deleted user likes this
Deleted user
August 25, 2024

Ok, makes more sense to me :) 
I can try that route, either azure functions or AWS Lambda.  

Like xzu likes this
0 votes
Marc -Devoteam-
Community Champion
August 23, 2024

Hi @[deleted] 

No you can't you can get the items maybe by creating an automaton rule that executes a webrequest to get the options and then you will need to create another webrequest to the JIra API store the options, then you will be able to use them in JIra.

But the options ned to be stored in Jira to be used.

Deleted user
August 23, 2024

Thanks for the reply. While researching more I found that I maybe should be able to do this with ScriptRunner. 
With that I should be able to call an external api and populate the options. 
I have not confirmed any of this. :) 

Marc -Devoteam-
Community Champion
August 23, 2024

Hi @[deleted]

Does the source you are trying to reach have an API option, if not, then you can't go the way I suggested.

If the source has an API, check the API docs on how to get the information.

Jira API docs can be found here: api.atlassian.com 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events