I need help.
Could someone help me write a script that changes the summary of another called.
I have in a customfield the KEY of this issue that I want to change.
import com.atlassian.jira.issue.IssueManager;
def issueManager = ComponentAccessor.getIssueManager()
def issue1 = issueManager.getIssueObject("${key_value}")
issue1.setSummary("XYZ")
I think this is what you're looking for. It will retrieve an issue, search that issue for a custom field which holds the key of a different issue, retrieve the issue using that key, set that issue's summary to some text.
import com.atlassian.jira.component.ComponentAccessor
def issueManager = ComponentAccessor.getIssueManager()
def customFieldManager = ComponentAccessor.customFieldManager
def issue = issueManager.getIssueObject("TSP-1")
def customField = customFieldManager.getCustomFieldObjectsByName("issue key")[0]
def keyOfIssueToChange = customField.getValue(issue)
def issueToChange = issueManager.getIssueObject(keyOfIssueToChange)
issueToChange.setSummary("MY NEW SUMMARY")
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.