Automation rule to calculate Start and end based on earliest start and latest end from linked issues
Asked by yeswanth Reddy:

Hi all,

I have create an automation rule to calculate Start and end time for an issue based on the earliest start and latest end from linked issues but look up issue isn't working can anyone please help me with this.![Screenshot 2024-08-13 080234.png](https://community.atlassian.com/t5/image/serverpage/image-id/341414i959AAE1E3312A81D/image-size/large?v=v2&px=999 "Screenshot 2024-08-13 080234.png")![Screenshot 2024-08-13 080504.png](https://community.atlassian.com/t5/image/serverpage/image-id/341413i4F08697A22549064/image-size/large?v=v2&px=999 "Screenshot 2024-08-13 080504.png")


Answers:
author: Trudy Claspill
body: Hello [@yeswanth Reddy](/t5/user/viewprofilepage/user-id/5566851)

Welcome to the Atlassian community.

It does not appear that you have provided the complete audit log entry for the rule. Can you provide that?

I can identify one problem from what you've provided.

In the Lookup Issues action you have referenced {{triggerIssue**s**. You have used a plural when it should be singular.

Additionally using that smart value by itself is not going to be valid JQL syntax. I suspect your audit log includes an error message about that JQL statement.

Another possible problem is your branch to Parent. Why are you shifting the focus to the parent of the issue that triggered the rule?

comments: author: Bill Sheboy
body: Hi [@yeswanth Reddy](/t5/user/viewprofilepage/user-id/5566851) -- Welcome to the Atlassian Community!

As Trudy describes, the JQL for your Lookup Issues actions is invalid, and...

Your rule seems to focus on specific link types (e.g., Blocks, Cloners, etc.) but the use of the links when creating your JQL does not check this. *As a result, issues with other link types will be returned.*

To solve this, you could invert your approach, and use the JQL function linkedIssues() to check by the types : <https://support.atlassian.com/jira-software-cloud/docs/jql-functions/#linkedIssues-->

For example:

```
issue IN linkedIssues( {{triggerIssue.key}}, "Blocks", "Cloners", "Duplicate", "Post-Incident Reviews", "Problem/Incident", "Relates to" )
```

Please adjust this to match your specific link types needed, and then test the query with an example issue to confirm it returns what you expected.

Kind regards,  
Bill


author: yeswanth Reddy
body: Thankyou, [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) and [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) for the response i will modify and try the same and keep you informed if it helped.


author: yeswanth Reddy
body: ![Screenshot 2024-08-14 074047.png](https://community.atlassian.com/t5/image/serverpage/image-id/341615iD4BF14632364A901/image-size/large?v=v2&px=999 "Screenshot 2024-08-14 074047.png")


author: yeswanth Reddy
body: i haven't got error in jql in audit log


author: Trudy Claspill
body: Well that is good news.

But I see that it also says No Actions Performed. Is that what you expected?

Does issue D1-45 have a Parent? It seems like the Log actions in your branch were not executed, which would be an indication that the trigger issue doesn't have a parent issue.


author: Dick
body: We should include the check if parent link is not empty in the JQL to know for sure that the automation is capable of branching for the parent. Now we don't have that check and we are misled by the intermediate loggings of stuff that has nothing to do with the branched issue.


author: Dick
body: Hi,

I think you have a typo in the second lookupIssues block:

triggerissue++**s**++.issuelink.key

There is only one triggerissue.

comments: author: yeswanth Reddy
body: hi [@Dick](/t5/user/viewprofilepage/user-id/4586768)

thankyou for the response.I have tried it but it didn't worked.


Tags: cloud

jira-service-management

jira-service-management-cloud