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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.