Due date is crossed ? configure pop-up drop-down for project manager to choose the reason
Asked by divya krishna:

Hi  
Due date is crossed. configure the pop-up drop-down for the project manager to choose the reason, and if due is not crossed, they should not get the pop-up. Could you please provide suggestions for this case?  


Answers:
author: Darryl Lee
body: SO... I don't think Atlassian provides a mechanism for creating "pop-ups".

I'm thinking one thing you could do (and you properly tagged this question) is create a Validator that forces the **Reason** field to be required if **Due Date** has past, and include a message explaining that.

The trick is that Validators only happen with specific transitions. So maybe you add this before somebody can Close a ticket. ("Hey you closed this ticket after it was due. Therefore you have to provide a reason why.")

Can you please let us know if you are on Cloud or Data Center so I could give a recomendation on how to create such a Validator?

comments: author: divya krishna
body: I am using cloud version


author: divya krishna
body: [@Darryl Lee](/t5/user/viewprofilepage/user-id/1365322) Could you please reply me


author: divya krishna

author: Darryl Lee
body: Hi [@divya krishna](/t5/user/viewprofilepage/user-id/1598824) - so what you're actually need is a *conditional* Validator.

And for that, you're going to need an add-on that allows you to implement a Jira Expressions. I wrote about this here:

* [Jira Expressions - But Why?](https://community.atlassian.com/t5/Jira-articles/Jira-Expressions-But-Why/ba-p/1694545)

Now, I wrote that a while ago, so it's possible there's an now add-on that provides a nice UI so you don't have to learn Jira Expressions, but under the covers, that's what really is happening.

Give me a little time and I'll come up with what you need.


author: Darryl Lee
body: Got it. So I used the FREE [Custom Workflow Condition, Validator \& Postfunctions](https://marketplace.atlassian.com/apps/1231933/extensions-for-jira-workflow-conditions-validators-free?hosting=cloud&tab=overview) to create Validator, but it would work with any of these (pricing for 100 users as of Jan 29, 2024):

* [Cloud Workflows](https://marketplace.atlassian.com/apps/1220407/cloud-workflows?hosting=cloud&tab=pricing&utm_source=docs&utm_medium=navbar&utm_campaign=cloud_workflows_docs): $500
* [JSU Automation Suite for Jira Workflows](https://marketplace.atlassian.com/apps/5048/jsu-automation-suite-for-jira-workflows?tab=pricing&hosting=cloud): $1,190
* [Jira Workflow Toolbox](https://marketplace.atlassian.com/apps/29496/jira-workflow-toolbox?tab=pricing&hosting=cloud): $1,250
* [Jira Misc Workflow Extensions (JMWE)](https://marketplace.atlassian.com/apps/292/jira-misc-workflow-extensions-jmwe?tab=pricing&hosting=cloud): $1,500
* [Power Scripts - Jira Workflow Automation](https://marketplace.atlassian.com/apps/43318/power-scripts-jira-workflow-automation?hosting=cloud&tab=pricing): $1,550
* [ScriptRunner for Jira](https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira?tab=pricing&hosting=cloud): $2,500

Here's the Jira Expression:
> new Date(issue.dueDate.toISOString() + 'T00:00:00') \>= new Date() \|\| issue.customfield_10151 != null

Where my customfield_10151 is a Single Select field. I think if your **Reason** field was text, you might be able to use **''** , but maybe **null** will work too.

Anyways, the ISO date thing was annoying. You might have to fiddle with it or tack on your timezone.)

But basically this is saying that for the transition to go through, one of these statements must be true:

* Due Date (at 00:00:00) \>= Current Date/Time
* Reason field must not be empty

Here's what it looked like in my workflow editor:

![Screenshot 2024-08-29 at 4.10.22?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/344687iA68EF079F3B7F1D7/image-size/large?v=v2&px=999 "Screenshot 2024-08-29 at 4.10.22?PM.png")

Hey [@Krzysztof Bogdan](/t5/user/viewprofilepage/user-id/1256398) - what does that green checkmark and 1 mean?

Whew, it's been a long time since I've written a Jira Expression. Painful. But fun stuff.


author: Krzysztof Bogdan
body: [@Darryl Lee](/t5/user/viewprofilepage/user-id/1365322)? - means expression syntax is ok.  

The number show expression complexity:  
<https://developer.atlassian.com/cloud/jira/software/jira-expressions/#expensive-operations>  

(There are limit how many operations expression execute)


author: divya krishna
body: we can implement this function in validator or conditions without using free add-on


author: divya krishna
body: [@Maciej Dudziak _Forgappify_](/t5/user/viewprofilepage/user-id/5267224) [@Darryl Lee](/t5/user/viewprofilepage/user-id/1365322)

Without using free add-on we can implement this function in validator or conditions

comments: author: Darryl Lee
body: Hi - are you asking whether you can implement this without an add-on?

The answer is no.


author: Maciej Dudziak _Forgappify_
body: Hi [@divya krishna](/t5/user/viewprofilepage/user-id/1598824)

I agree with [@Darryl Lee](/t5/user/viewprofilepage/user-id/1365322)

What you need is a Jira expression-based validator, which allows you to create conditional validations.

If you're interested in learning how to build expressions related to dates, our team has created the Dates Compare Validator, which is part of the [Workflow Building Blocks for Jira](https://marketplace.atlassian.com/apps/1233642/workflow-building-blocks-for-jira?hosting=cloud&tab=overview) free app. With a wizard-like UI, you can select options that match your case. We provide a Jira expression preview section where you can see the expression generated by the UI. It looks like this:

![community_30.08.24.png](https://community.atlassian.com/t5/image/serverpage/image-id/344725i32E655714113790B/image-size/large?v=v2&px=999 "community_30.08.24.png")

Then, you can use the generated expression, expand upon it, and apply it with our [Jira Expression Validator](https://docs.forgappify.com/workflow-building-blocks-for-jira/jira-administrator/validators/jira-expression-validator) to handle your case:

```
(issue.dueDate != null 
  && new Date(issue.dueDate.toISOString()+'T00:00:00+00:00') >= new Date()) 
    ? true
    : issue.customfield_xxxxx != null
```

You need to change the ID of the custom field to a valid one. In the editor, after 'issue.', start typing the name of the field, and you will get suggestions with the correct value.

If your field is a customfield, then in most cases checking against null is correct way to make it required. In other cases you can check our Fields Required Validator, which also has a preview section to learn how to make it right.

I hope it will help.

Cheers

comments: author: Darryl Lee
body: Oh man, [@Maciej Dudziak _Forgappify_](/t5/user/viewprofilepage/user-id/5267224) your app is very very cool! I should've figured that given enough time, clever developers would make apps that would alleviate users from having to learn Jira Expressions (as much "fun" as it can be.)


author: Maciej Dudziak _Forgappify_
body: Thank you Darryl :)


Tags: condition

validator