Hello!
I am trying to build an manual automation rule that, when triggered, will create a new issue and copy certain fields. One of those fields is a custom date field called "Subscription Renewal Date". I would like to copy over the Month and Day, but update the year. For example, we have an software renewal for this year (2024) with a Subscription Renewal Date of 12/01/2024, and once that subscription is renewed, the manual automation rule would be triggered to create a new issue for next year (2025) to track the renewal. So I would like to copy the Subscription Renewal Date over to the new issue but update year to 2025, so the new date would be 12/01/2025. How can I achieve this?
Thanks!
Jacquelyn
Hi @Jacquelyn Mosby -- Welcome to the Atlassian Community!
Please try using either of these functions:
plusYears() function: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-plus-unit---
withYear() function: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-with-attribute---
Kind regards,
Bill
Thank you for your reply! Would I need to add that in the "Additional Fields" section? And is this the correct format: {{issue.customfield_10187.withYear(2025)}} ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should not need to use advanced edit with JSON.
Instead, you may try typing / copy-and-pasting that expression directly in the field for the Edit Issues action. When the expression appears below the field, select it for use in the edit.
Re-reading your original question: do you want to "set" the year or "increment" it from the field's current year?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Bill Sheboy I am not sure I understand your question completely, but I would like date in the newly created issue to have the same month and day as the current issue, but set the year to the following year. So if the subscription renewal date for this year was 12/01/2024, the subscription renewal date for next year should be 12/01/2025.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It appears you always want to increment the year, and so try pasting this directly in the field with the edit action:
{{issue.customfield_10187.plusYears(1)}}
That will appear below the field in the Edit Issue action, and then it may be selected for use.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.