Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

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

Jira issue due date not older 30 days

Алексей Попов October 26, 2022

hello, there is a task when creating a task to prohibit setting a date older than 30 days, I will be grateful for any help.

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 26, 2022

Hello @Алексей Попов 

You will need to add a Validator to the Create Transition in the workflow for that Issue Type in that Project. With a validator you can check the value of the date field to confirm that it is not older than 30 days. If the date is older than 30 days, the validator will prevent creation of the issue.

Refer to: https://confluence.atlassian.com/adminjiraserver/advanced-workflow-configuration-938847443.html

Only a Jira Administrator can modify the workflow.

Алексей Попов October 26, 2022

Hi.

I'm sorry, I did not put it correctly, but I know that it is necessary to add a validator. The problem is that when I add the jql "custom_field < 30d" validator, respectively, instead of custom_field specifying my field, it does not work, and prohibits the creation of tasks at all

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 26, 2022

Your JQL is incorrect. When you use "30d" you are telling Jira to add 30 days to the current date. Your current JQL is comparing your custom field to a date 30 days in the future.

To compare to a date in the past you need to use "-30d"

Алексей Попов October 26, 2022

but after all, I need to check that the date in my field is not older than 30 days, for example today is 10/27/2022 and if I create a task on 11/28/2022 an error, and everything that is included in the interval 10/27/2022-11/28/2022 there is no error and the task is being created.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 27, 2022

I don't think we are using the term "older" the same way. 

Are you adding this validator to the Create Issue transition or another transition in the workflow?

To avoid confusion please provide specific examples:

- You create issue ABC-123 on <date1>

- You set the Custom field date to <date2> in issue ABC-123

- On <date3> you try to transition ABC-123 from Status <X> to Status <Y> and it should fail

- On <date4> you try to transition ABC-123 from Status <X> to Status <Y> and it should succeed

 

<date3> and <date4> should be the dates closest to the cutoff.

 

Additionally, please confirm that your custom field is a Date or Date/Time type of field.

Can the custom field have no value at the time the transition is tried?

Алексей Попов October 27, 2022

yes, my field is of type date, thanks already solved this problem, added a validator to the groovy transition that reads "my_field <= new Date().plus(30)" which is completely suitable for my case, that the date should not be more than 30 days from current date.

Suggest an answer

Log in or Sign up to answer