Add comment after seven days in the same status

Use case

Add a comment to the issues in a certain status whose status has not been updated in 7 days.


⚒️ 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 Daily

Interval

Set to Once per day at 1 00 am

JQL selector

Add Selector JQL selector

JQL Query

Use the following expression:

Bash
project = CASE and status = "Wating for Customer"

This JQL query will retrieve the issues of the CASE project and in Waiting for Customer status.

Do not forget to change the key of the project and the status in your own automation rule.

Boolean condition

Add Condition → Boolean condition

Expression

Use the following expression

Bash
datePart(lastFieldChangeTime(%{selector.issue.status}), LOCAL) = addDays(datePart({system.currentDateTime}, LOCAL), -7 , LOCAL)

Add comment action

Next to JQL Selector click on Add → Action → Add Comment

Comment's text

Bash
Hello %{selector.issue.reporter},

We have not received an answer in 7 days. The issue will close itself automatically tomorrow.

Best regards,
%{system.currentUser.displayName}

Enable the rule by clicking on the Enable button

📤 Import the example 

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

JSON

After importing the JSON file, make sure to check the configuration of the rule. Non-existing configuration elements (issue types, fields, values etc.) will be highlighted.

JavaScript
{
"name": "Add comment after 7 days in status",
"description": "",
"creator": "admin",
"status": false,
"triggerData": "",
"triggerType": "SCHEDULED",
"configuration": {
"refs": [
"issue",
"system",
"trigger.issue",
"trigger.parent"
],
"runAs": "admin",
"scheduledTriggerCron.dailyWeeklyMonthly": "daily",
"scheduledTriggerCron.daysOfMonthOpt": "dayOfMonth",
"scheduledTriggerCron.monthDay": "1",
"scheduledTriggerCron.week": "1",
"scheduledTriggerCron.day": "1",
"scheduledTriggerCron.interval": "0",
"scheduledTriggerCron.runOnceHours": "1",
"scheduledTriggerCron.runOnceMins": "0",
"scheduledTriggerCron.runOnceMeridian": "pm",
"scheduledTriggerCron.runFromHours": "1",
"scheduledTriggerCron.runFromMeridian": "am",
"scheduledTriggerCron.runToHours": "1",
"scheduledTriggerCron.runToMeridian": "am",
"triggerType": ""
},
"children": [
{
"sequence": 0,
"type": "JQL_SELECTOR",
"ruleEntityType": "SELECTOR",
"configuration": {
"refs": [
"system"
],
"jql": "project = CASE and status = \"Wating for Customer\"",
"jqlParsingMode": "jql",
"actingUser": "field_00020"
},
"children": [
{
"sequence": 0,
"type": "BOOLEAN_CONDITION",
"ruleEntityType": "CONDITION",
"configuration": {
"refs": [
"issue",
"issues",
"selector.issue",
"selector.parent",
"system"
],
"expression": "datePart(lastFieldChangeTime(%{selector.issue.status}), LOCAL) = addDays(datePart({system.currentDateTime}, LOCAL), -7 , LOCAL)",
"expressionParsingMode": "logical",
"actingUser": "field_00020"
},
"children": [
{
"sequence": 0,
"type": "ADD_COMMENT",
"ruleEntityType": "ACTION",
"configuration": {
"refs": [
"issue",
"issues",
"selector.issue",
"selector.parent",
"system"
],
"comment": "Hello %{selector.issue.reporter},\r\n\r\nWe have not received an answer in 7 days. The issue will close itself automatically tomorrow.\r\n\r\nBest regards,\r\n%{system.currentUser.displayName}",
"commentParsingMode": "textBasic",
"actingUser": "field_00020",
"commentVisibility": "everybody",
"sendMail": "true"
},
"children": null,
"hasChildren": false
}
],
"hasChildren": true
}
],
"hasChildren": true
}
],
"hasChildren": true
}


📚 Related use cases