Hi All,
Im having abit of trouble copy comment values of an issue into a description field, the purpose is that i would like for the value to appear as read only.
The read only customfield appear to only hold 250 also max character which i have alot more of so im stuck with the 2 option of:
1) Find a way to extend the 250+ character max value for the read only customfield; or
2) copy the value to the field description (Which i prefer)
the current code i have is which currently pulls the last comment value from a sepcific user:
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(10806), emailThread)
ComponentAccessor.getIssueManager().updateIssue(
ComponentAccessor.getJiraAuthenticationContext().getUser()
, issue
, UpdateIssueRequest.builder().eventDispatchOption(EventDispatchOption.ISSUE_UPDATED).sendMail(false).build()
)
return emailThreadAny help is much appreciated.
Cheers,
Pon
There is a custom field type "Unlimited text". Try to use this one.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.