Forums

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

Create a batch of automated tickets for the month with changing due dates each month

NCFMS Renewals October 4, 2019

Hello all,

I've been trying to figure this out with Scriptrunner and with Insight but have been unable to...looking for some community assistance!

Background...we have a group of monthly deliverable's that are planned out each month. Dates change for them each month and some dates are dependent on others, ie if something is delivered late, it may push another deliverable timelines further out.

We've got:

1. Multiple deliverable's due throughout the month (daily, weekly, monthly, bi-monthly, etc) 

2. Each deliverable has due dates like - 2nd business day of the month, every Friday, daily by 11am, etc

We have to plan and report on all of these - about 93 tasks ...all hit at least once during the month, about 10 happen daily, and about 7 happen weekly. 

I've currently set up my issue types with components...no issues on project set up, but cannot figure out how to automate a batch creation at the beginning of the month for planning purposes...AND have different start and end times for say the weekly and daily tasks. Is this even possible? 

I've been able to set up a ticket creation through insight, but this only allow me to create one ticket at a time. I've looked at automation plugins, but this gives me the same thing.

 

Any ideas on how to do this so we don't have to create these each month by cloning and manually resetting each date?

2 answers

0 votes
Gezim Shehu [Communardo]
Community Champion
October 7, 2019

Hmmm, it looks like a long requirement. But I think solveable nonetheless.

I'd suggesting using references from a previous article of mine

Recurring Tasks in Jira

 

Basically my approach would be:

Configure a "template" project - or a single point of truth for the task entity

Configure appropriate labels or another field to filter frequencies

Clone the issues periodically and link them to a target project

Also, on the template project, you could keep the latest due date actual vs expected info for example in a custom field. When creating issues for next month, you could check that date from the template and adjust accordingly the new due date (example 2 weeks + days over due from the last issue)

 

I think this could work easily.

 

Cheers

0 votes
Lady Di
Atlassian Partner
October 4, 2019

Hello! Your task can be solved with the free Mygroovy plugin.

The creation period is controlled using regular cron expressions.

Creating the tasks or any other automation is controlled by groovy scripts.

img-2019-10-04-17-52-55.png

 

Code example of creating a task:

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.IssueFactory
import com.atlassian.jira.user.ApplicationUsers
import com.atlassian.jira.user.UserUtils
import groovy.time.TimeCategory

def user = ComponentAccessor.userManager.getUserByName("jellyrunner")
createIssue(user)

def createIssue(user) {
def mutableIssue = createMutableIssue(user)
ComponentAccessor.issueManager.createIssueObject(user, mutableIssue)
}

def createMutableIssue(user) {
def issueFactory = ComponentAccessor.getComponentOfType(IssueFactory.class)
def Format = "dd.MM"
def today = new Date()
def currentDate = today.format(Format)
def newIssue = issueFactory.getIssue()

newIssue.projectId = 10080
newIssue.issueTypeId = "52"
newIssue.summary = "Periodic Issue ${currentDate}"
newIssue.reporterId = "jellyrunner"
newIssue.priorityId = "3"
newIssue.resolutionId = ""
newIssue.description = """


return newIssue
}

 

There is also a module to create periodic task templates in the Mail.ru Calendar plugin.
But there, templates are created by any users and based on existing tasks.

img-2019-10-04-17-59-07.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events