Validator: Remaining Estimate cannot be empty

C_S_ July 10, 2019

Hello,

I want a workflow to only run when the field remaining estimate is not empty.
When starting the transition, the following screen shows:

2019-07-10 14_44_09-Do-_Done - DBG JIRA.jpgBy default, the "Remaining Estimate" is empty.
My validator looks like this:

issue.getEstimate() != ''

 I have also tried

issue.getEstimate() != null

 Both codes don't work. After confirming, the transition just runs and the status is changed.

I just ran a test to see if the getEstimate works and the validator

issue.getEstimate() == 3600

 returns the following after confirming:

2019-07-10 14_48_45-Do-_Done - DBG JIRA.png

The error message was defined by me, so no worries there.
Obviously the validator works now.
I noticed that I left the remaining estimate empty, then clicked, and suddenly the remaining estimate is automatically filled with the original estimate and the error message shows.

So, TLDR:

How do I set up a validator to block remaining estimate from being empty?

 

2 answers

0 votes
C_S_ October 16, 2019

Any more ideas?

I am still having that problem.

0 votes
Radhika Vijji _Innovalog_
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.
July 10, 2019

Hi Christian,

Which validator and add-on are you using to do this? The Remaining estimate is picking the value from the Original estimate because the "Legacy Mode" is on in your Time Tracking settings. With this on, the original estimate and remaining estimate are linked. You can uncheck it to avoid it. 

Regards,

Radhika

C_S_ July 10, 2019

I am using the 

'Script Validator [ScriptRunner]' Validator

Legacy mode is already disabled.

 

To give a little bit more context:
At the end of each month project responsibles have to give an estimate about how much work is left for that project to the project management, to identify possible budget overruns early.
Because we want them to think about the real remaining estimate (including every non-planned activities) instead of just saying "last month we had 100h left, we worked 35h this month on that project, so remaining has to be 65h", I set it up in a way that the remaining estimate gets cleared when doing the transition.

I now want to avoid that an empty estimate is given by accident, so I need the validator.

 

edit:

I also tried using the following validator:

Fields Required (JSU)

  • Required fields:
    • Remaining Estimate
  • Error message (optional): Remaining Estimate cannot be empty

This results in the following screen:

2019-07-11 08_23_57-Do-_Done - DBG JIRA.png

Remaining estimate now looks like a mandatory field, I am still able to simply confirm the transition and it will run just fine and fill in the original as the remaining automatically...

Suggest an answer

Log in or Sign up to answer