Created
January 15, 2013 21:39
-
-
Save jechlin/4542341 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package examples | |
import com.atlassian.jira.component.ComponentAccessor | |
import com.atlassian.jira.issue.Issue | |
import com.atlassian.jira.issue.ModifiedValue | |
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder | |
Issue issue = issue | |
def customFieldManager = ComponentAccessor.getCustomFieldManager() | |
def customField = customFieldManager.getCustomFieldObjectByName("Country") | |
def targetField = customFieldManager.getCustomFieldObjectByName("Unique ID") | |
def cfValue = issue.getCustomFieldValue(customField) ?: "NONE" | |
def changeHolder = new DefaultIssueChangeHolder(); | |
targetField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(targetField), cfValue + "-" + issue.id.toString()), changeHolder); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment