Whenever i try to update my custom field , the old value gets deleted and the new value takes its place . But here i need the new value to be appended to the old one .
I am using ScriptRunner for jira .
You need to use the addLabel () method from LabelManager:
I did not notice that the label field is custom. For a custom field of type label, the answer will look like this:
def issueManager = ComponentAccessor.getIssueManager()
MutableIssue issue = issueManager.getIssueObject("MYP-1")
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def customLabelFieldID = customFieldManager.getCustomFieldObject("customfield_10100").getIdAsLong()
def labelManager = ComponentAccessor.getComponent(LabelManager)
labelManager.addLabel(currentUser, issue.getId(), customLabelFieldID, "123", false)
ComponentAccessor.getIssueManager().updateIssue(currentUser, issue, EventDispatchOption.ISSUE_UPDATED, false)
Learn how to use two new reports for next-gen projects in Jira Cloud: Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events