Forums

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

Automate due date in Dependency in Advanced roadmap

Spartans
Contributor
July 14, 2023

Hi Team,

 

My question is about the dependency due date changes.

For Example:

I have a project with 3 stories with some dates.

dependency.PNG

1. Test-1 - 17th Jul- 31st Jul

2. Test-2 - 1st Aug - 16th Aug

3. Test -3  -  17th Aug - 31st Aug

Now If "TEST-1" cannot be completed in time and takes 1 day extra. (i.e., completes on 1st Aug). I need the "TEST-2" task to be automatically changed to 2nd Aug - 17th Aug and the Third should start on with 18th Aug - 1st Sep. 

I have a Json Script for it

"

{
  "cloud": true,
  "rules": [
    {
      "id": 13092381,
      "clientKey": "72b7eade-078c-35bf-97f4-c86e09f1ac1b",
      "name": "Update start date",
      "state": "ENABLED",
      "description": "",
      "authorAccountId": "61d7fc9df3037f0069298117",
      "actor": {
        "type": "ACCOUNT_ID",
        "value": "557058:f58131cb-b67d-43c7-b30d-6b58d40bd077"
      },
      "created": 1686816633939,
and so on........,
But I'm Unable to apply this rules in Automation, since I don't know more sure of (When , Condition and Then to use )   or is there any simple rule for automating the above one.
If there, please help me with the solution with a Screenshot of automation rules.

1 answer

1 vote
Trudy Claspill
Community Champion
July 14, 2023

Hello @Spartans 

You have said that you are using Advanced Roadmaps, but you have also tagged your post as being for the Free version of the product. The Free version of the product doesn't include Advanced Roadmaps.

Are you using a Trial or Paid subscription of the Premium product?

You can use auto-scheduling in AR to automatically adjust dates on dependent issues, but it will adjust other issue dates also.

If you don't want to use auto-scheduling, then you can adjust dates through Automation Rules with a rule like this:

Screen Shot 2023-07-14 at 12.31.57 PM.png

 

However, what you end up creating is a rule that detects a change made by a previous execution of the same rule, and causing the rule to be called again for a new issue. There is a limit to how many times Jira allows that to happen, and that limit is 10. If you had a chain of dependencies of more than 10 issues, the Automation Rule would not be able to update all of the dependent issues.

Spartans
Contributor
July 15, 2023

The Screenshots are from my organizational account and I'm using this account for asking community so that I can have a look.

Okay then is there any other ways to make it happen.
Also this is the full code.

{
  "cloud": true,
  "rules": [
    {
      "id": 13092381,
      "clientKey": "72b7eade-078c-35bf-97f4-c86e09f1ac1b",
      "name": "Update start date",
      "state": "ENABLED",
      "description": "",
      "authorAccountId": "61d7fc9df3037f0069298117",
      "actor": {
        "type": "ACCOUNT_ID",
        "value": "557058:f58131cb-b67d-43c7-b30d-6b58d40bd077"
      },
      "created": 1686816633939,
      "updated": 1687165052244,
      "trigger": {
        "id": "277076674",
        "component": "TRIGGER",
        "parentId": null,
        "conditionParentId": null,
        "schemaVersion": 2,
        "type": "jira.issue.field.changed",
        "value": {
          "changeType": "ANY_CHANGE",
          "fields": [
            {
              "value": "duedate",
              "type": "field"
            }
          ],
          "actions": []
        },
        "children": [],
        "conditions": [],
        "connectionId": null
      },
      "components": [
        {
          "id": "277076675",
          "component": "BRANCH",
          "parentId": null,
          "conditionParentId": null,
          "schemaVersion": 1,
          "type": "jira.issue.related",
          "value": {
            "relatedType": "linked",
            "jql": "",
            "linkTypes": ["blocks"],
            "onlyUpdatedIssues": false,
            "similarityLimit": 40,
            "compareValue": 0
          },
          "children": [
            {
              "id": "277076677",
              "component": "ACTION",
              "parentId": "277076675",
              "conditionParentId": null,
              "schemaVersion": 10,
              "type": "jira.issue.edit",
              "value": {
                "operations": [
                  {
                    "field": {
                      "type": "NAME",
                      "value": "number"
                    },
                    "fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:float",
                    "type": "SET",
                    "value": "{{Start date.diff(triggerIssue.Due date).days.plus(1)}}"
                  }
                ],
                "advancedFields": null,
                "sendNotifications": true
              },
              "children": [],
              "conditions": [],
              "connectionId": null
            },
            {
              "id": "277076681",
              "component": "ACTION",
              "parentId": "277076675",
              "conditionParentId": null,
              "schemaVersion": 10,
              "type": "jira.issue.edit",
              "value": {
                "operations": [
                  {
                    "field": {
                      "type": "NAME",
                      "value": "Start date"
                    },
                    "fieldType": "com.atlassian.jira.plugin.system.customfieldtypes:datepicker",
                    "type": "SET",
                    "value": "{{triggerIssue.Due date.plusBusinessDays(1)}}"
                  }
                ],
                "advancedFields": null,
                "sendNotifications": true
              },
              "children": [],
              "conditions": [],
              "connectionId": null
            }
          ],
          "conditions": [],
          "connectionId": null
        }
      ],
      "canOtherRuleTrigger": true,
      "notifyOnError": "NEVER",
      "projects": [],
      "labels": [],
      "tags": [
        {
          "id": 34758869,
          "tagType": "IS_RULE_UPDATED",
          "tagValue": "true"
        }
      ],
      "ruleScope": {
        "resources": ["ari:cloud:jira:d9259933-1e47-443b-9b58-a49f30db7476:project/10001"]
      },
      "writeAccessType": "UNRESTRICTED",
      "collaborators": [],
      "billingType": "NORMAL"
    }
  ]
}
Will this be able to make any changes ?
Trudy Claspill
Community Champion
July 15, 2023

I prefer to look at rules based on the UI display rather than slogging through JSON code.

If you'd like to provide screen images of that, I'll review it.

Or, you can simply try out your rule against test issues and see what it does.

Spartans
Contributor
July 16, 2023

I tried with your automations, but its getting failed on condition and you were also that it will not be applicable for more dependencies. So I was thinking for a better resolution from you.

I had received a code from a person stating that this would work, but I'm unable to do the automation, where to paste the code.

Is there any other ideas that can do the dependency mapping on due date linked with other start date as above ?

I tried with used cases, YouTube but unable to find a best resolution.

But its not working.

Trudy Claspill
Community Champion
July 16, 2023

I said you would need to use a rule like the one I provided. You would need to adjust it for your use case specifically. My use case was for sub-tasks. Based on the image your use case is for a different issue type, so you would need to modify the rule.

The code you have been given is what one gets when one uses the Export feature to export an Automation Rule. It is still an automation rule, but in a different format.

Screen Shot 2023-07-16 at 10.41.22 AM.png

You can't paste the code into a Rule. You have to import the code so it will create a Rule. Rules can be imported only from the Global Automation page.

Screen Shot 2023-07-16 at 10.44.31 AM.png

 

I suspect that your code/rule will run into the same limitation. I exported a copy of my rule and the code looks very similar to yours, so I suspect that they are structured the same. The limitation applies to all Automation Rules where an action taken by the rule will cause the rule to be executed again.

Spartans
Contributor
July 17, 2023

I tried as per your automation, but its getting success and since I'm trying on a sample project to test it. If it gets success then I can apply it in our Project.

Also I have created only stories. So I chose stories Issue type = Story.

Attaching the Screenshot    

de1.PNGDependency-error-1.PNG

Trudy Claspill
Community Champion
July 17, 2023

Is there a reason you have not simply imported the Automation Rule code you were given, with the help of a Jira Administrator if you don't have sufficient access?

 

Regarding your attempt to recreate the rule I provided as an example, the message is indicating you have this box checked.

Screen Shot 2023-07-17 at 9.30.21 AM.png

Is it your intention to only update linked issues that have been updated since the last time the rule executed?

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