Make post-function work after screen fields update

I have resolution screen with 'log work' fields (time spent, remaining estimate), which appears on the 'Resolve' transition. Also I have added post-function to 'Resolve' transition setting remaining estimate to 0h. But the problem is that post-function works before log work fields values are stored into database. More specifically, remaining estimate is updated automatically based on 'original estimate' and 'time spent' values after it was flushed by post-function.

Is there a way to make my post-function work after resolution screen fields update?

Edit: here is the screenshot of post-functions ordering:

5 answers

1 accepted

1 vote
Accepted answer

It turns out that I needed to use 'Set Field Value' post-function (choose 'Remaining Estimate' field and '0h' as a value) instead of 'Clear Field Value' post-function in order to reset remaining estimate on resolution.


can you post a screen shot of your postfunctions?

maybe re-ordering the functions could help.

i.e. place the function below the field update

screenshot has been added

on your resolution screen (default) there should appear "Remaining Estimate"....isn't this set to "Adjust automatically" ?

i just tried...

created an issue and set due to tomorrow...

if i click resolve and leave "remaining estimate" on "adjust auto..." the worklog shows "Remaining: 0m"

i wonder what you're tryin to achieve

maybe the postfuction that purges Remaining Estimate is the wrong step

I do not know how you have managed to do this :), but when I resolve issues and set 'time spent' on the resolution screen using default JIRA configuration, remaining estimate is not set to 0h automatically by default (without any post-functions).

so i also wonder how this is not working for you :)

i simply hit resolve...added 5m to time spent and left the selection for "Remaining Estimate" to "Adjust automatically" more tricks...

also no custom postfunctions are configured (only the defaults)

did you have original estimate?


, did you have original estimate?

no i didn't set estimate during create..

the whole point is that original estimate should be set so that remaining estimate will be calculated as the difference originalEstimate - timeSpent

yes you're right...

remaining estimate will be the value ("original Estimate" reduced by "time spent")

i just added original estimate and the remaining estimate is set that way

that is not the solution you want?

do you want remaing estimate to be set to 0h when the issue gets resolved?

yes, that's right. I want remaing estimate to be set to 0h when the issue gets resolved

I think you're trying to do too much in the one step. The data submitted as part of the form, doesn't get saved until the end. So if you have apost function which finds the issue, it's probably pulling data from the database (which hasn't been updated yet with the data submitted in the form).

Any kind of function to over-write data entered by the suer will have to go just before the fire issue post function and it will also have to manually perform a re-index. Just be careful, if you use high level helper functions, to do the update, you could end up also firing an update event as well as your issue resolved event.

The other option is that you create a loopback transition (Resolved -> resolved) that has condition that will only let it happen if the remaining estimate != 0, then you make it an automatic transition by exporting it xml and adding the auto attribute

In this transition, you would put the custom post function which would just wipe remaining estimate. So when a user triggers resolved transaction and estimate !=0, it auto fires

Mind you sounds like a lot of fuss to do soemthing not very conventional either. Why not leave the data in place and use it to improve estimate


Hm, maybe is a question of the tool used to do this ...

Try this one:

create a post function, put it at the end, edit it and just write as the postfunction body:

estimate = "0h"

That should do the trick.

it worked. but I'm not sure I can persuade management to buy jjupin (even though it is not that expensive) plugin only for the minor task of remaining estimate reset just because JiraCannotDoItOutOfTheBox ... :(

yeah, I know. But isn't it funny .... :)

Try adding the Store issue post function after each of the 2 postfunction you have added to purge the fields

I do not have 'Store issue' post-function at the list of post-functions in my JIRA. Do I need to install some plugin in order to make it avilable?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

968 views 3 9
Read article

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