Workflow: check period field larger or smaller than?
Hello.
Quick question if anyone could help me :)
I would like to make a workflow that checks on a state update that the estimate field is filled in and is smaller than 4h (except when a member from the "manager" group does it.
I have the first part working fine, the second part that needs to check the time OR user being a manager I have no idea about.
this is what I have.
{
assert Estimation != null: "An estimate is required";
}
I haven't found documentation revolving the periods in the work flow.
Thank you!
Quick question if anyone could help me :)
I would like to make a workflow that checks on a state update that the estimate field is filled in and is smaller than 4h (except when a member from the "manager" group does it.
I have the first part working fine, the second part that needs to check the time OR user being a manager I have no idea about.
this is what I have.
when State.becomes({Todo})
assert Estimation != null: "An estimate is required";
}
I haven't found documentation revolving the periods in the work flow.
Thank you!
Please sign in to leave a comment.
unfortunately you cannot simply compare the period fields yet, please vote/comment the http://youtrack.jetbrains.com/issue/JT-18128
But the workaround is available, you can use the following valid construction: (now - Estimation) < now - 4 hours
If you need to check that user is/isn't included into the "manager" group use loggedInUser.isInGroup("managers").
Please let me know if it's enough to implement your case.
Your workaround works like a charm and the solution is sufficient for me.
You just saved me a lot of overhead at work, thank you! ;)