Close tickets after version release

Use case

Close issues periodically at the end of the day according to the release date of its fix version.

🗒️ Prerequisites

Set the release dates of the fix versions

In Project settings > Versions check that the versions have the appropriate release date.

⚒️ Configuration

Create a new rule and name it appropriately.

Providing a description will help you to identify what the rule does but this step is optional.

Scheduled trigger

Add a TriggerScheduled and choose who you want to execute this rule in Run as

Schedule

Choose Days per Week

Interval

Set to Once per day at 11 55 pm and check the days of the week when the versions can be released.

JQL selector

Add Selector JQL selector

JQL Query

Use the following expression after replacing the project name.

Bash
project = "Project Name"

Boolean condition

Add a Condition → Boolean condition

Expression

Bash
dateToString(first(releaseDates(%{selector.issue.fixVersion})),SERVER_LOCAL,USER_LANG) = dateToString({system.currentDateTime},SERVER_LOCAL,USER_LANG)

Transition issue

Add → Action → Transition issue

Set the mode to Transition to status and choose the status Done.

Enable the rule by clicking on the Enable button

📤 Import the example

Import the JSON file below to get started in no time.

JSON
JavaScript
{
"name": "Close tickets after version release",
"description": "Close issues periodically according to the release date of its fix version.",
"creator": "admin",
"status": false,
"triggerData": "",
"triggerType": "SCHEDULED",
"configuration": {
"refs": [
"issue",
"system",
"trigger.issue",
"trigger.parent"
],
        "runAs": "admin",
        "scheduledTriggerCron.dailyWeeklyMonthly": "daysOfWeek",
        "scheduledTriggerCron.daysOfMonthOpt": "dayOfMonth",
        "scheduledTriggerCron.monthDay": "1",
        "scheduledTriggerCron.week": "1",
        "scheduledTriggerCron.day": "1",
        "scheduledTriggerCron.interval": "0",
        "scheduledTriggerCron.runOnceHours": "11",
        "scheduledTriggerCron.runOnceMins": "55",
        "scheduledTriggerCron.runOnceMeridian": "pm",
        "scheduledTriggerCron.runFromHours": "1",
        "scheduledTriggerCron.runFromMeridian": "am",
        "scheduledTriggerCron.runToHours": "1",
        "scheduledTriggerCron.runToMeridian": "am",
        "scheduledTriggerCron.weekday": "6"
    },
 "children": [
{
"sequence": 0,
"type": "JQL_SELECTOR",
"ruleEntityType": "SELECTOR",
"configuration": {
"refs": [
"system"
],
"jql": "project = \"Project Name\"",
"jqlParsingMode": "jql",
"actingUser": "field_00020"
},
"children": [
{
"sequence": 0,
"type": "BOOLEAN_CONDITION",
"ruleEntityType": "CONDITION",
"configuration": {
"refs": [
"issue",
"issues",
"selector.issue",
"selector.parent",
"system"
],
"expression": "dateToString(first(releaseDates(%{selector.issue.fixVersion})),SERVER_LOCAL,USER_LANG) = dateToString({system.currentDateTime},SERVER_LOCAL,USER_LANG)",
"expressionParsingMode": "logical",
"actingUser": "field_00020"
},
"children": [
{
"sequence": 0,
"type": "TRANSITION_ISSUE",
"ruleEntityType": "ACTION",
"configuration": {
"refs": [
"issue",
"issues",
"selector.issue",
"selector.parent",
"system"
],
"option": "status",
"status": "10001",
"actingUser": "field_00020"
},
"children": null,
"hasChildren": false
}
],
"hasChildren": true
}
],
"hasChildren": true
}
],
"hasChildren": true
}


📚 Related use cases