Hello,
I have 4 priorities set up:
If the creator picks Rush Job, it needs Lead approval. If the Lead rejects the job as being a Rush, the creator needs to go back and EDIT the priority (by clicking the pencil icon on the issue) to one of the other three priorities. They would then click a button called "Fixed Priority" to transition the issue. Clicking the button without changing the priority would give a warning with a message.
Currently, the code only works if they change it to 1-4, but not any of the others; it returns a warning.
My current code in the Post-Function validator (Simple Script Validator) is:
if (issue.priority?.name == '1-4' || issue.priority?.name == '5-6' || issue.priority?.name == '7') {
issue.priority!= originalIssue.priority
}Can anyone tell me what I'm doing wrong or have correct code/advice? Thank you!
The final working code (checks that priority is set to specific options rather than check if it changed):
issue.priority?.name == '1-4' || issue.priority?.name == '5,6' || issue.priority?.name == '7'