Can I use the value of one custom field to make a selection for a second custom field?

Hi there!

JIRA have the wonderful custom fields and I plan on allowing tickets to be made which the option of allocating the documentation page of the project in Confluence. So basically I want a user to select a project in JIRA using a Project Picker (or something similar) and the project they picked will be sent to the second custom field.
This second custom field will grab the documentation page with the same project name (yes we make sure they are identical) as a URL Field which gives me an URL to said page.

So is this possible? One custom field giving a value to a second custom field who then shows an URL in the issue to the documentation in Confluence.


4 answers

1 accepted

0 votes
Answer accepted

While my question was about grabbing one value from another, my main goal was to make a link for JIRA to use. A JIRA Project issue is where I wanted to go but a JIRA Project itself can hold a link to the Confluence Space in its sidebar.

For people who are trying to succeed in grabbing a value from one custom field and giving it to another, I suggest you look at the answer of Doug Swartz and Amar as Scriptrunner is pretty useful in that regard.

For people like myself who purely wanted a link, you can just click "Add link"  in the sidebar from a JIRA Project and also under integrations under the cog in a Confluence Space you can add a link also.

Thank you for your answers! 

If you're running in the cloud, as indicated by the tags on the question, I don't have an answer for you. If you're running on jira-data center, you can do this by making your second custom field a calculated field in the Script Runner plugin. You should also be able to do it with the Kepler Custom Field plugin, although I've not used the Kepler plugin.

Oops! Jira-Cloud isn't the right tag. My mistake. I will try what you suggested! Thanks.

Something like a cascading select?

There is at least one add-on, but I haven't tried it.

Script runner behavior plugin is the perfect solution for your problem

This is the sample code available at script runner website hope it helps

import com.atlassian.jira.component.ComponentAccessor

// set a select list value -- also same for radio buttons
def faveFruitFld = getFieldByName("Favourite Fruit") 
def optionsManager = ComponentAccessor.getOptionsManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customField = customFieldManager.getCustomFieldObject(faveFruitFld.getFieldId())
def config = customField.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)
def optionToSelect = options.find { it.value == "Oranges" } 

// same example but setting a multiselect - also same for checkboxes fields
def subComponentFld = getFieldByName("Subcomponent")
customField = customFieldManager.getCustomFieldObject(subComponentFld.getFieldId())
config = customField.getRelevantConfig(getIssueContext())
options = optionsManager.getOptions(config)
def optionsToSelect = options.findAll { it.value in ["Oranges", "Lemons"] } 

Hi, to be honest I really have no idea how this works. Do you perhaps have some sort of tutorial at hand? This is really quite new to me.

Hey Jackson, M also new bee, tutorial is available at Lets learn together

Lol accidently used the account of a friend when asking you about this. Thanks for your link!

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 09, 2018 in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

383 views 6 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you