Hi All,
Im having abit of issue transferring a value to either a view only field (255 max character, i have more than this) or to a description of a customfield.
Im currently pulling a comment value from specific per below code:
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.MutableIssue import com.atlassian.jira.event.type.EventDispatchOption import com.atlassian.jira.issue.UpdateIssueRequest CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager() MutableIssue issue = ComponentAccessor.getIssueManager().getIssueObject('TEST-429') def userKey = "customer.care" def commentManager = com.atlassian.jira.component.ComponentAccessor.getCommentManager() def comments = commentManager.getComments(issue) def lastCommentFromUser = comments?.findAll {it.authorApplicationUser.key == userKey} def emailThread = lastCommentFromUser.last().body def setVal = issue.setCustomFieldValue(customFieldManager.getCustomFieldObject(11803), emailThread) ComponentAccessor.getIssueManager().updateIssue( ComponentAccessor.getJiraAuthenticationContext().getUser() , issue , UpdateIssueRequest.builder().eventDispatchOption(EventDispatchOption.ISSUE_UPDATED).sendMail(false).build() ) return customFieldManager.getCustomFieldObject(11802)
Any help would be appreciated.
Cheers,
Pon
Your code seems to be correct. What namely do you want to do?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.