Forums

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

Automation Help: Create 10 Issue Clones, Different Due Dates

Linda C
April 4, 2023

I'm playing around with Jira automation to manage compliance tasks that must be tracked and completed at set intervals.

Having trouble writing an automation rule that will do the following:

  • Trigger: Upon manual trigger <-- I think I can figure out (tbd)
  • Condition: For select label criteria in a project <-- I think I can figure out (tbd)
  • Action: Create 11 clones of original issue; each one w/ a different due date (30th of each month after the month of original issue).  <-- Struggling greatly

Any help would be appreciated.

Thanks!

1 answer

0 votes
Thanos Batagiannis [Adaptavist]
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 Champions.
September 28, 2016

Hi there,

So the condition for the specific role (and assume you mean a project role)

Issue issue = issue
def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def roleManager = ComponentAccessor.getComponent(ProjectRoleManager)
def projectRole = roleManager.getProjectRole("Administrators")
 
//if project role Administrators does not exist return false
if (!projectRole)
    return false

//will return true or false if the user is in Administrators role
def isInRole = roleManager.getProjectRoleActors(projectRole, issue.getProjectObject())?.getApplicationUsers()?.contains(user)
 
//the value of a multi select field has the value 'My value'
def hasValue = 'My value' in cfValues['My Multi List']*.value
 
//or any other combination
return isInRole &amp;&amp; hasValue

regards, Thanos

Suggest an answer

Log in or Sign up to answer