Hi All,
We have this function in JIRA service desk it communicate other JIRA instance and create ticket in that JIRA during the transition.
The following code is a part of the script and it successfully create tickets in other JIRA as they are coping only system fields.
In a new issue type there is a mandatory custom field called "Sub Priority" that should be filled to create the ticket. I tried several ways but none of them help me to copy the custom field to the new ticket.
Can someone help me to insert custom field in this script?
Thank you for your help.
import com.atlassian.applinks.api.ApplicationLinkResponseHandler
import com.atlassian.applinks.api.ApplicationLinkRequest
import com.atlassian.applinks.api.ApplicationLinkService
import com.atlassian.applinks.api.ApplicationLink
import com.atlassian.applinks.api.application.jira.JiraApplicationType
import com.atlassian.applinks.api.CredentialsRequiredException
import com.onresolve.scriptrunner.runner.util.UserMessageUtil
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.sal.api.net.Request
import com.atlassian.sal.api.net.Response
import com.atlassian.sal.api.net.ResponseException
import com.atlassian.sal.api.net.ResponseHandler
import com.atlassian.jira.issue.comments.DefaultCommentManager
import com.atlassian.jira.issue.IssueManager
import groovy.json.JsonBuilder
import groovy.xml.MarkupBuilder
import groovy.json.JsonSlurper
import com.atlassian.jira.security.JiraAuthenticationContext
import com.atlassian.jira.util.json.JSONObject
import static com.atlassian.sal.api.net.Request.MethodType.POST
def body_req = [
fields: [
project: [
key: "ARC"
],
summary: issue.summary, //Take from the current ticket
description: issue.description, //Take from the current ticket
issuetype: [
name: "RFS"
]
]
]
How are you trying to send the custom field?
You should do it by id (id of field in the other instance)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.