Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Do a transition post functions run when the transition is executed using the API?

David Moore
Contributor
January 12, 2020

While my question is related to a use case that involves ScriptRunner I guess this is question that should be directed straight at JIRA / Atlassian...

If I execute a transition using the API - do that transition ID's post functions actually run?

The workflow's conditions are validated, but as far as I can see the post functions are not being run, maybe I am missing something so thought I would check...

I am fairly confident I can script the field updates and assignments I need, but I just assumed the post functions would fire...

Thanks!

2 answers

1 accepted

0 votes
Answer accepted
Fernando Bordallo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 12, 2020

Hello @David Moore

Indeed that should be the case. Any post functions bound to a workflow transition should be triggered when transitioning the issue, even when done through the API.

David Moore
Contributor
January 12, 2020

Thanks for the prompt response @Fernando Bordallo!

There are a couple of layers of complexity here, I am using ScriptRunner and a roles based estimation app (here). The post function that is failing is a simple reassignment to a user identified in by a Role...

The same post function works as expected through the UI.

Something must be wrong then, I'll need to do some testing...

I will update this post when I get to the bottom of it.

Thanks!

Like Fernando Bordallo likes this
David Moore
Contributor
January 14, 2020

Okay, wrapping around for completeness...

The app we use stores data in the issues "properties", the post function supplied by them to provide the functionality to re-assign during the post function does not function when the transition is called through the API.

The atlassian supplied post function (which essentially does the same thing) works just fine...

I will submit a bug ticket to the app supplier. I have scripted a work around with ScriptRunner to correct this in the meantime.

Thanks for the help @Fernando Bordallo

Like Fernando Bordallo likes this
Fernando Bordallo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 14, 2020

Thank you for updating the thread :)

Like David Moore likes this
1 vote
Hernan Halabi - Elite IT Consulting Group
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 12, 2020

Hi @David Moore  transitions work the same way regardless if you are using UI or via REST API. I suggest you play with your transition from the user interface until you are certain it does as it should (mainly because it's easier) and then when you do it via API you will see the same results

Suggest an answer

Log in or Sign up to answer