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'
Hi @Megan D
Have you try
if (issue.priority?.name == '1-4' || issue.priority?.name == '5-6' || issue.priority?.name == '7') {
return issue.priority?.name != originalIssue.priority?.name
}
Regards
That didn't end up working, however, I finally figured something out. I made it a bit simpler.
Instead of checking if the priority was changed from the original, it checks to see if the priority is one of other options.
Working code:
issue.priority?.name == '1-4' || issue.priority?.name == '5,6' || issue.priority?.name == '7'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.