//Thiswasarequestfromapotentialcustomer//Therequirementswerethatthepricewasenteredasanumber//andtheThirdPartyRelationshipwaschosenfromasingleselectlist//thentheAssigneeisassignedautomaticallyaspartofacreateissuetransitionpostfunctionimportcom.atlassian.jira.component.ComponentAccessordefcustomFieldManager=ComponentAccessor.getCustomFieldManager()defnumberCf=customFieldManager.getCustomFieldObjectByName("Purchase Amount")defselectCf=customFieldManager.getCustomFieldObjectByName("Third Party Relationship")defpurchaseAmount=issue.getCustomFieldValue(numberCf)asdoubledefthirdPartyRelationship=issue.getCustomFieldValue(selectCf)if(purchaseAmount<5000){issue.setAssigneeId('agrant')}else{if((purchaseAmount>=5000)&&(purchaseAmount<=10000)){if(thirdPartyRelationship=='value A'){issue.setAssigneeId('user1')//Changeuser1totheappropriateuserinJIRA}else{issue.setAssigneeId("user2")//Changeuser2totheappropriateuserinJIRA}}else{//purchaseAmount>10,000andthirdPartyRelationshipshouldbeirrelevantissue.setAssigneeId("user2")//Changeuser2totheappropriateuserinJIRA}}
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.