How do I copy name of issuetype in custom field?
Hi, it should be something like
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.event.type.EventDispatchOptionimport com.atlassian.jira.issue.fields.CustomFieldimport groovy.transform.Field// ID of the fieldfinal String customFieldId = "10101"// the name of a 'text field' custom fieldfinal String issueTypeName = issue.issueType.namedef issueService = ComponentAccessor.issueServicedef loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUserdef issue = ComponentAccessor.issueManager.getIssueByCurrentKey(issueKey)def issueInputParameters = issueService.newIssueInputParameters().with {// set text fieldsaddCustomFieldValue(customFieldId, issueTypeName)}def updateValidationResult = issueService.validateUpdate(loggedInUser, issue.id, issueInputParameters)assert updateValidationResult.valid: updateValidationResult.errorCollectiondef issueUpdateResult = issueService.update(loggedInUser, updateValidationResult, EventDispatchOption.ISSUE_UPDATED, false)assert issueUpdateResult.valid: issueUpdateResult.errorCollection
I used this snippet: https://library.adaptavist.com/entity/update-the-value-of-custom-fields-through-the-script-console
Thanks, but how do I do this using automation?
Hi, you need to describe your usecase...you are on server...so you have scriptrunner installed? Do you have automation for jira App?
I have an installed version of the server, as well as installed automation, but no scriptrunner
It looks like you're new here. Sign in or register to get started.