Open Bhavya-ss opened 5 days ago
def issueKey = issue.key def requestType = issue.fields.customfield_10010?.requestType?.name?.toString()
print "Issue Key: ${issueKey}" print "Request Type: ${requestType}"
if (requestType == "Fix an account problem") { def newRequestParticipants = [ [ "accountId": "63060b97189e0a3a4ff283dc" ], [ "accountId": "630a0d15ec02b5f28b63a024" ] ]
print "New Request Participants: ${newRequestParticipants}" def updateResult = put('/rest/api/2/issue/' + issueKey) .header('Content-Type', 'application/json') .body([ fields: [ customfield_10127: newRequestParticipants // Use the correct custom field ID ] ]) .asString() print "Update Result: ${updateResult}" def usersToNotify = newRequestParticipants.collect { participant -> [accountId: participant.accountId] } print "Users to Notify: ${usersToNotify}" def notify = post("/rest/api/2/issue/${issueKey}/notify") .header("Content-Type", "application/json") .body([ subject: "Issue ${issueKey} was just created", htmlBody: """ Please copy and paste ${issueKey}""", to: [ users: usersToNotify ] ]) .asString() print "Notification Result: ${notify}"
}
def issueKey = issue.key def requestType = issue.fields.customfield_10010?.requestType?.name?.toString()
print "Issue Key: ${issueKey}" print "Request Type: ${requestType}"
if (requestType == "Fix an account problem") { def newRequestParticipants = [ [ "accountId": "63060b97189e0a3a4ff283dc" ], [ "accountId": "630a0d15ec02b5f28b63a024" ] ]
}