Hello, I'd like to create a JIRA ticket field where its value is based on the value of two other custom fields.
For instance, the values could be:
Custom field 1: coffee
Custom field 2: cup
I would then end up with the following being displayed:
Custom field 3: coffee_cup
Custom field 3 doesn't necessarily have to be editable. I'm using JIRA Server 8.5. Any help would be much appreciated!
John
You can also do this with a Power Scripts custom field.
Could do it in 1 line.
return customfield_10000 + " _" + customfield_10001;
Any options that don't utilize a plug-in? I have a feeling my organisation may not permit third-party apps...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, you'll need a plugin. You'll find Scriptrunner can do it in one line of code too, and soon, without any code at all. And Autoblocks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
CustomField cf86900 = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_86900")
String cf86900Value = issue.getCustomFieldValue(cf86900)
CustomField cf87301 = ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_87301")
String cf87301Value = issue.getCustomFieldValue(cf87301)
CustomField cf87001 =ComponentAccessor.getCustomFieldManager().getCustomFieldObject("customfield_87001")
issue.setCustomFieldValue(cf87001, cf86900Value + " " + cf87301Value)
Kind regards,
Mo
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.