Bhavya-org / Scripts

0 stars 0 forks source link

assignee issue if request type matches #25

Open sani-d opened 3 weeks ago

sani-d commented 3 weeks ago

def issueKey = issue.key

def requestType = issue.fields.customfield_10010?.requestType?.name

if (["Budget - Cost Approval", "Budget - SSOT Change requests", "Budget - New Headcount Request", "PUR - New Software Budget Approval Request", "PUR - Software Procurement Approval", "PUR - Software Renewal Approval"].contains(requestType)) {

def newAssigneeAccountId = '5d8ce04a6e35df0c4997a324' // Use the account ID of the new assignee def updateResult = put('/rest/api/3/issue/' + issueKey + '/assignee') .header('Content-Type', 'application/json') .body([ accountId: newAssigneeAccountId ]) .asString() } else { println("Request type is not 'Budget - Cost Approval', 'Budget - SSOT Change requests', 'Budget - New Headcount Request', 'PUR - New Software Budget Approval Request', 'PUR - Software Procurement Approval', 'PUR - Software Renewal Approval', skipping automated comments.") }