Working on a project and have a unique request that I can't seem to figure out if it's possible or not.
The team has a static master list of documents that are required based on a country choice.
For example, the master list has 5 documents, but for Country A only 2 of those documents are required, but for Country B all 5 documents are required.
They would like a checklist of those documents to be changed based on the country choice so if you were to select Country A, the document checklist column would only show 3 choices, but if you were to select Country B, all 10 would be displayed.
Is this possible in JIRA? Happy to purchase a 3rd party add-on to make it possible as well. I looked into Dynamic Forms but I believe this can only show/hide entire fields, not values within a field.
Thanks for any help! :)
The sample code to get this working is as follows:
This requirement is achievable using Behaviour feature. You may refer to our sample code in the library about Dynamic Select.
Based on the sample, I configured the server side script for the "Country", which will trigger every time the value change:
import com.atlassian.jira.component.ComponentAccessor def country = getFieldById(getFieldChanged()) def countryValue = country.getValue() as String def optionsManager = ComponentAccessor.getOptionsManager() def customFieldManager = ComponentAccessor.getCustomFieldManager() def checkboxes = getFieldByName("Checkboxes") def customField = customFieldManager.getCustomFieldObjectsByName("Checkboxes")[0] def fieldConfig = customField.getRelevantConfig(getIssueContext()) def fieldOptions = optionsManager.getOptions(fieldConfig) def optionUS = [ 'Option 1', 'Option 2', 'Option 3' ] def optionUK = [ 'Option 2', 'Option 3' ] switch (countryValue) { case "US - United States": checkboxes.setFieldOptions(fieldOptions.findAll {it.value in optionUS}) break case "UK - United Kingdom": checkboxes.setFieldOptions(fieldOptions.findAll {it.value in optionUK}) break }
Check out ScriptRunner for Jira. This plugin has functionality called Behaviors which can be used to accomplish what you want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nice job! If you want to post the code, others may find the answer and be helped!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Kevin Ultsh fully agree with @Kian Stack Mumo Systems Scriptrunner is the way to go here. Behaviors will do exactly this, and it's only a part of the add-on.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Kevin Ultsh there is help on using Behaviours here: https://docs.adaptavist.com/sr4js/latest/features/behaviours
This is one of the common use cases for Scriptrunner behaviours. It would be good to get your feedback on setting it up.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Craig Nodwell @Kian Stack Mumo Systems We actually have Script Runner and I looked into Behaviors but wasn't sure if it was possible to hide/show values of a field, or just hide/show entire fields. I will review it again. Thanks for the heads up.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.