Get excpetion change status from Post Function

OdedMozesh December 4, 2016

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

0 votes
OdedMozesh December 6, 2016

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