Status not updating when transitioning with script in post-function

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

This widget could not be displayed.

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

This widget could not be displayed.

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

This widget could not be displayed.

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?

This widget could not be displayed.

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.

This widget could not be displayed.

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?

This widget could not be displayed.

Did you post your code so we can see it?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

136 views 1 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