//Thiswasarequestfromapotentialcustomer//Therequirementswerethatthepricewasenteredasanumber//andtheThirdPartyRelationshipwaschosenfromasingleselectlist//thentheAssigneeisassignedautomaticallyaspartofacreateissuetransitionpostfunctionimportcom.atlassian.jira.component.ComponentAccessorimportcom.atlassian.jira.issue.fields.CustomFielddefprojectComponentManager=ComponentAccessor.getProjectComponentManager()defcustomFieldManager=ComponentAccessor.getCustomFieldManager()defuserUtil=ComponentAccessor.getUserUtil()defnumberCf=customFieldManager.getCustomFieldObjectByName("Purchase Amount")defselectCf=customFieldManager.getCustomFieldObjectByName("Third Party Relationship")defpurchaseAmount=issue.getCustomFieldValue(numberCf)asdoubledefthirdPartyRelationship=issue.getCustomFieldValue(selectCf)if(purchaseAmount<5000){issue.setAssigneeId('user1')//Changeuser1totheappropriateuserinJIRA}elseif((purchaseAmount>=5000)&&(purchaseAmount<=10000)){if(thirdPartyRelationsip=='value A'){issue.setAssigneeId('user1')//Changeuser1totheappropriateuserinJIRA}else{issue.setAssigneeId("user2")//Changeuser2totheappropriateuserinJIRA}}else{issue.setAssigneeId("user2")//Changeuser2totheappropriateuserinJIRA}
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.