Creating issue - End Date field has to be greater than Start Date field

Rob B
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.
April 21, 2021

User is creating and issue and has 2 date fields....

Start Date and End Date - Is there a way to stop the user being able to enter an earlier date than the Start Date in End Date

3 answers

1 accepted

3 votes
Answer accepted
Phill Fox
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 21, 2021

HI @Rob B 

Yes this would be implemented as a validator on the create transition. 

Note to access the create transition you need to view the workflow in diagram mode and select the line from the grey circle. 

Depending on whether this is an on premise or cloud instance will then impact how you can compare the dates. 

Cloud

Screenshot 2021-04-21 135957.png

Screenshot 2021-04-21 140042.png

On Premise

To do date comparisons on premise you need to use a plugin here is an example using JSU

Screenshot 2021-04-21 140835.png

An alternative is to use Scriptrunner and base the script off the information at https://library.adaptavist.com/entity/calculate-the-difference-between-two-dates

This latter option gives you greater flexibility in terms of checking for a minimum gap between the dates for example or checking for the existence of both fields. 

Rob B
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.
April 21, 2021

Thanks Phil! Ill give it a go

0 votes
Manisha Kharga _Appfire_
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.
April 21, 2021

Hi @Rob B ,

 

We have opened a support ticket, https://beecom-products.atlassian.net/servicedesk/customer/portal/3/JSU-3493 to better track your request. However, we couldn't add you as a reporter. 

Please sign up using this link 
https://beecom-products.atlassian.net/servicedesk/customer/portal/3/user/signup and share the user name/id. We'll then add you as the reporter and confirm. 

Thanks,
Manisha

Manisha Kharga _Appfire_
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.
April 21, 2021

Hi @Rob B ,

Please add the Date Compare (JSU) validator to the specific workflow transition.

val-jsu.jpg

Now, save and publish the workflow and rerun the scenario, if the End date is smaller than the Start date, you will see the error message. Please refer to the below gif file for details.

new- (1).gif

Please let us know if you face any issues.

 

Thanks,
Manisha

Like Phill Fox likes this
0 votes
Lukáš Meitner April 21, 2021

Hi Robert,

it is possible to validate these date fields during the create transition. You must edit the workflow and add the "Date Compare Validator" validation to the create transition. Please see https://confluence.atlassian.com/adminjiraserver/advanced-workflow-configuration-938847443.html#Advancedworkflowconfiguration-validators.

Best regards, Lukas

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.13.1
TAGS
AUG Leaders

Atlassian Community Events