Hi,
I would like to copy the field value from "Fix Version" to "Release Category" custom field using Script Runner behaviors.
My goal would be to have this custom field "Release Category" updated whenever an issue's fixVersion is set OR the existing fixVersion's value is updated.
Please suggest .
Hi Vasanth,
I have answered a similar question here, using a Script Field to pull in data from the Fix Version field: https://community.atlassian.com/t5/Jira-questions/Copy-Fix-Version-field-value-to-Release-Category-using-Behaviors/qaq-p/786991#M254086
I'm not sure you will want to use a behaviour. Behaviours function on the Create Issue, Update/Edit Issue, Assign Issue, and Workflow Transition screens. If someone manages to edit the Fix Version(s) field through a different method, the value wouldn't be copied to the new custom field. If you don't expect that to happen, then I suppose a behaviour would work. You could also write a Script Listener that sets the "Release Category" field automatically whenever an issue is updated/created with a new value in the Fix Version field.
Thanks,
Josh
Thanks Joshua.
Link you have shared redirect me to the same page, is there any other link you are referring to?
Also, any chance you could help me with the grovvy script for listener?
My scenario: Copy fixversion value to release category(which is multi select custom field) whenever its updated.
Thanks
Vas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using the below code in listener to update "Release Name" from "fixVersion" but getting error
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.component.ComponentAccessor
def issue = event.issue as Issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def tgtField = customFieldManager.getCustomFieldObjects(event.issue).find {it.name == "Release Name"}
def calcField = customFieldManager.getCustomFieldObjectByName("Fix Version/s")
def changeHolder = new DefaultIssueChangeHolder()
tgtField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(tgtField), issue.getCustomFieldValue(calcField)),changeHolder)
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.
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.