Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,465,131
Community Members
 
Community Events
176
Community Groups

Add values to select list via automation

I'm trying to find a way to add values to a single select list via automation or workflow.   Is there any way to currently do this?   I've searched but unable to find a solution so far.   I found the following which matches my use case but am not sure how to implement: https://stackoverflow.com/questions/22892537/how-to-add-new-values-to-select-list-field-in-jira-dynamically-or-using-plug-in/23198416#23198416

 

2 answers

Hi @David Loszewski ,

Using automation or workflow post-function are easy ways to accomplish what you are looking for.

Are the values predefined (always the same) or do they come from a different field?

https://confluence.atlassian.com/automation/advanced-field-editing-993924663.html would give you a hint on how to update a field with automation. 

You can set the updated field with a permanent field, iterate an if-else based in some values so the field is updated based on another or copy value from another field.

 

The native post-function is a bit restricted on updating fields, so it will depend on which plugins you may have

@Samuel Bartolome I think your response assumes that I already have the values in the field.  I may not have been clear.  I'm trying to add an option/value to a single select list which, typically this is done manually through Issues -> Custom Fields -> <Field in question> -> Contexts and Default Values

I'm trying to accomplish the same thing through automation and/or addon script.   

The following is my use case: 

1. Single Select List Custom Field: Customers 

2. Text Field: New Customer

When a person enters a form with a value in New Customers, I want that value to be added as a list option on Customers.  

Not sure you can achieve that  with automations, but probably you can do it with Scriptrunner as a listener maybe. 

In Scriptrunner there is already a build-in option (on-prem) to update values of fields in bulk, so  with that and the listener (if available in Cloud), it may do the trick

jira cloud -> automation -> action -> Send web request

Request URL:  https://yoursite.atlassian.net/rest/api/3/field/customfieldID/context/contextID/option

Headers:

Authorization: ******

Accept: application/json

 

method: Post

web request body: Custom data

Custom data:

 

{
"options": [
{
"disabled": false,
"value": "new option value"
}
]
}

 

please refer to this link: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

jira cloud -> automation -> action -> Send web request

Request URL:  https://yoursite.atlassian.net/rest/api/3/field/customfieldID/context/contextID/option

Headers:

Authorization: ******

Accept: application/json

 Method: Post

web request body: Custom data

Custom data:

 

{
"options": [
{
"disabled": false,
"value": "new option value"
}
]
}

 

please refer to below links: 

Send web request with Automation: https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

JIRA Rest API:https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-custom-field-options/#api-rest-api-3-customfieldoption-id-get

 

 

Suggest an answer

Log in or Sign up to answer