Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Assign value to another field based on dropdown (recurring issues)

Deleted user July 26, 2020

I am attempting to make a recurring issue automation rule that based on the "Recurrence" custom dropdown field, which has the following options:

  • Weekly
  • Every 2 weeks
  • Monthly
  • Every 2 months
  • Every 3 months
  • Every 6 months
  • Yearly

Then clones the issue back to the "TO DO" column with the due date incremented when the issue is moved to the "DONE" column on the Kanban.

I have the following smart value but it doesn't match when I select "Weekly" on the dropdown:

{{#if(eq(issue.fields.Recurrence.value, "Weekly"))}}{{issue.duedate.plusWeeks(1)}}{{/}}
{{#if(eq(issue.fields.Recurrence.value, "Every 2 weeks"))}}{{issue.duedate.plusWeeks(2)}}{{/}}
{{#if(eq(issue.fields.Recurrence.value, "Monthly"))}}{{issue.duedate.plusMonths(1)}}{{/}}
{{#if(eq(issue.fields.Recurrence.value, "Every 2 months"))}}{{issue.duedate.plusMonths(2)}}{{/}}
{{#if(eq(issue.fields.Recurrence.value, "Every 3 months"))}}{{issue.duedate.plusMonths(3)}}{{/}}
{{#if(eq(issue.fields.Recurrence.value, "Every 6 months"))}}{{issue.duedate.plusMonths(6)}}{{/}}
{{#if(eq(issue.fields.Recurrence.value, "Yearly"))}}{{issue.duedate.plusYears(1)}}{{/}}

 The clone issue action:

image.pngThe Recurrence dropdown:

image.png

I have logged the value of the recurrence as json and it is a string:

image.png

I'm using the "next-gen Kanban" project.

1 answer

1 accepted

0 votes
Answer accepted
Deleted user July 27, 2020

Seems like using eq did not work but the combination of .trim().startsWith() did:

{{#if(issue.fields.Recurrence.value.trim().startsWith("Weekly"))}}{{issue.duedate.plusWeeks(1)}}{{/}}
{{#if(issue.fields.Recurrence.value.trim().startsWith("Every 2 weeks"))}}{{issue.duedate.plusWeeks(2)}}{{/}}
{{#if(issue.fields.Recurrence.value.trim().startsWith("Monthly"))}}{{issue.duedate.plusMonths(1)}}{{/}}
{{#if(issue.fields.Recurrence.value.trim().startsWith("Every 2 months"))}}{{issue.duedate.plusMonths(2)}}{{/}}
{{#if(issue.fields.Recurrence.value.trim().startsWith("Every 3 months"))}}{{issue.duedate.plusMonths(3)}}{{/}}
{{#if(issue.fields.Recurrence.value.trim().startsWith("Every 6 months"))}}{{issue.duedate.plusMonths(6)}}{{/}}
{{#if(issue.fields.Recurrence.value.trim().startsWith("Yearly"))}}{{issue.duedate.plusYears(1)}}{{/}}

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events