Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage
Highlighted

condition to if then true else false

Need a condition for Jira's workflow: something like

// If input equal or less then true
jira.issue.worklog.value <= jira.issue.originalestimate.value
return true;

Else

// If input more than then true false
jira.issue.worklog.value > jira.issue.originalestimate.value
return false;
});

 

Any help will be much appreciated :)

3 comments

John Funk Community Leader Nov 09, 2019

Hi Kate - Welcome to the Atlassian Community!

I don't believe that is going to be possible with out of the box Jira. However, if you use an add-on like JMWE or ScriptRunner you should be able to do that. 

Like Kate Austen likes this

Thanks for the reply John. I realized Jira's out of the box settings does not allow something this specific.

The coding apps are a bit difficult. I would need help into writing the correct code for this.

John Funk Community Leader Nov 09, 2019

JMWE offers great support with their syntax, as well as others here. Should be something straight forward. 

Dear John, just wanted to let you know that it is also not possible with the JMWE app after their developers told me they do not support this for Jira Cloud users.

John Funk Community Leader Nov 11, 2019

So sorry about that - would have thought they would be able to compare two fields. Is there something more involved than that?

As simple as it sounds in theory they said Jira Cloud is just too limited and that there are no workaround apps for it as there is also a Cloud bug when it comes to validating the timeSpent with originalEstimate.

I am now looking into creating a trigger to transition an issue once a user logged more time than the estimate field with the Automation app.

John Funk Community Leader Nov 11, 2019

Sounds reasonable. I guess you could dump the value into a couple of custom fields and then compare them also. 

Hi Kate, 

it is definitely possible to have conditions in Jira's workflow. There are quite a few conditions (and validators) that come out-of-the-box and even more that come from Marketplace Apps. 

From you code examples I gather that you want to hide a transition if more work has been logged than was originally estimated; you will need a Marketplace App for that. There are few options available, but in my biased opinion Cloud Workflows is a great option, as it supports Jira Expressions as workflow conditions.

Here's how you would solve your scenario with Cloud Workflows:

  1. Add a "[CW] Custom Jira Expression" condition to your workflow
  2. Enter the following Jira Expression:
issue.timeSpent <= issue.originalEstimate

Publish your changes and you're done!

Full disclosure: I work for Jodocus, the Vendor who created Cloud Workflows. Let me know if you need any help getting started, I'll be happy to help!

Cheers,

 Oliver

Like # people like this

Hi Oliver,

Thank you for your response! So far the Cloud Workflow app is the most user friendly as ScriptRunner and the others are a bit more complicated.

I have tried your suggestion and it works perfectly!

Blocking the transition to which status I choose it to.

However, instead of blocking the transition, I need something to block the actual action of a user logging to not be allowed to log more than the original estimated field. Is this maybe possible?

Like # people like this

Hi Kate,

Glad to hear our app works for you! 

However, instead of blocking the transition, I need something to block the actual action of a user logging to not be allowed to log more than the original estimated field.

I understand that it would be even better to catch invalid input (ex. overbooking) at the moment the user enters data (ideally at the UI level), but I'm afraid that is much harder to achieve with Jira. Specifically with Jira Cloud I am not aware of any way to perform this kind of input validation – although it would certainly be a useful feature.

Like Jan Szczepanski likes this

I would also suggest the Automation app, pretty easy to use. 

 

Concerning validation of time logged it also can be done with automation, little bit complicated, but they got pretty good documentation. You should start with updated field trigger and advanced condition.

Dear Blazej Borucki,

 

Thanks. I managed with the Automation for Jira application.

Like Blazej_Borucki likes this

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Jira Software

How to create Jira issus from Excel file?

When to use CSV importer When managing your processes in Jira, there are many occasions where you need to create a lot of tasks. Creating them one by one will cost you a lot of time and effort and i...

4,529 views 22 32
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you