Get excpetion change status from Post Function

Hi,

 

We need that when we change sub-task status, its Story status changes.

I wrote a post function (using  script runner) on a transition.

The story has validators on its transitions.

When I change sub-task's status and the validator blocks the change of the Story status (tried to be done by the post function), I get exception message.

The exception prevents the status change of the Sub-task itself too (I just need to display message but not to block the status change of the current issue (Sub-task)).

  1. I added try block surround the post function code, but It does not catch the exception
  2. The exception message is different from the message I get if I try to change the Story status manually.

In case the validators don't block the change of the Story, it works fine.

 

How can I handle the exception?

Is there other way to change status of related issue in case of status change (Sub-task -> Story, Story -> Epic)? a way that does not block the caller issue status and enable me to provide meaningful message.

 

Thanks in advance,

Oded

1 answer

There are two main issues:

  1. Action produces an exception which is not caught by try-catch block (in the code I do transition which is blocked by validator - it causes exception that is not caught, and stop everything - see the next point)
  2. The post function blocks the current action (what is expected from pre-function, not post function) - post function on sub-task transition => exception in the code stops the transition and the subtask left in the previous status.

 

We appreciate your help

Please advice

Nic Brough [Adaptavist]

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Friday in Jira Service Desk

Looking for anyone who has switched from Zendesk to Jira Service Desk

Hi Community! The Jira Service Desk marketing team is looking for customers who have successfully switched from Zendesk to Jira Service Desk!   We’d love to hear your thoughts on the pros and ...

152 views 8 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you