Status not updating when transitioning with script in post-function

Thomas Heidenreich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2014

rephrased to make it simpler:

A post-function on issueA (child) fires a script that transitiones issueB (parent). On issueB there is a script post-function which transitions all is subtasks (i.e. issueA and it s siblings)

The siblings are up dated but not the issueA which fired the first post-function.

In the activity log of issueA there is an entry for the transition, but the status stays the same and the integrity check says "workflow entry with wrong stepId".

--- old question start ---

We have two workflows for tasks and subtasks which update each other, the main task follows the following statuses:

Level 1 Approval -> Level 2 Approval -> Approved

 

with the possibility to go directly to Approved if the custom field risk is set to low.

 

The subtasks follow the following steps:

Security Approval -> Security Approved -> Ready for Work

 

When going to Security Approved in the subtask there is a post-function which checks if all other subtasks have been Security Approved and then updates the main task to either Level 2 Approval or Approved (depending on the risk)

 

When the main tasks goes to Approved it takes all it s subtasks and transitions them from Security Approved to Ready for Work - for low risks this happens directly when the last subtask is set to Security Approved as there is no Level 2 Approval.

 

Here comes the problem:

When I set the last subtask to Security Approved the main task is correctly updated to Approved (script 1). This should trigger the transition to Ready for Work on all subtasks, but the last subtask set to Security Approved stays there(script 2).

The changelog shows an entry "status changed from Security Approved to Ready for Work" but the status shows as Security Approved (but the available workflow action are those of Ready for Work)

A reindex does not help, but the integrity check says that there is a workflow entry with wrong stepId - clicking fix here shows the workflow actions for Security Approved in the issue as if the transition to Ready for Work never happened.

Do I need to do some manual reindexing or database persisting in script 1? The post-functions are placed after the event throwing.

Hope this is understandable and someone has a hint...

--- old question end ---

 

Thanks,

Thomas

6 answers

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 9, 2014

Did you post your code so we can see it?

0 votes
Thomas Heidenreich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 8, 2014

It´s been a while and we want to go move to the pilot phase this week... Any suggestions or ideas who to solve this?

Michal Gubis March 21, 2019

Hello Thomas,

we are experiencing exactly the same problem. Have you been able to solve this in any way?

0 votes
Thomas Heidenreich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 25, 2014

Yes, they are all last in the list.

Do you know where the timing issue is? I could add a delay at the start of the second script if that would help, but I d rather call some action, that synchronizes things properly (if there is any).

What mainly confuses me is that a reindex does not fix it, and that the activity log shows the action from the second script.

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 24, 2014

Hrm... so effectively A (the child) gets updated twice, once when the user updates it, and then again through a script running on the parent.

This kind of thing is tricky, it's similar to the "fast-track transition" script, which has some code to deal with this and other timing issues.

I don't know... you may need to update B with a delay. But then the UI may not show the correct status. Tricky.

Are all your post-functions last in the list?

0 votes
Thomas Heidenreich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 24, 2014

Hi Jamie,

thanks for the feedback - I thought being thorough would make it easier, but I ll rephrase:

The problem is:

A post-function on issueA (child) fires a script that transitiones issueB (parent). On issueB there is a script post-function which transitions all is subtasks (i.e. issueA and it s siblings)

The siblings are up dated but not the issueA which fired the first post-function.

In the activity log of issueA there is an entry for the transition, but the status stays the same and the integrity check says "workflow entry with wrong stepId".

Hope this is easier to understand.

Thanks
Thomas

0 votes
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 24, 2014

The question is too complex, which is why you haven't got any answers. Can you try to isolate the problem a bit better?

Suggest an answer

Log in or Sign up to answer