Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Append additional Affected Service to existing via Automation

andrew_pass
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 10, 2022

Hi,

Been trying to figure this out and tried reading the various different posts and guides but can't seem to get this working so sending up a flare :)

My use case is -

I have a number of affected services linked to a parent, I'm trying to set up a rule whereby if someone adds a child it then recognizes this and adds the parent to the list.

At the moment I can only get it to either completely replace all the values and just add the parent I can't seem to get it to add the parent in addition.

 

Logic is, that for an incident, as a developer / logging tool I might say that API-X is impacted so add it to affected services.

As an incident / change manager I want to easily be able to see all tickets impacting that and also the system in general. 

Rule runs like this - 

  • Affected Service added, call it Y
  • Branch rule with a condition - object HAVING inboundReferences("Name" = X)
  • Update Affected Services with the X

End result is Affected Services, Y, X are added to ticket.

Hopefully that all makes sense :)

Thanks!

2 answers

1 accepted

2 votes
Answer accepted
andrew_pass
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 14, 2022

I got this working :)

So the key was on my edit of the field via advanced I used this -

{
"fields": {
"Affected services":[{"id": "{{lookupObjects.Service ID}}"},{{#issue.Insight - Services}}{"id":"{{Service ID}}"}{{^last}},{{/}} {{/}}]
}
}

The {{lookupObjects.Service ID}} is grabbing the ID of the parent service and then appending it onto the call.

Is now a lot simpler -

  • When value changes for Insight - Services custom field,
  • If the Object matches IQL object HAVING inboundReferences("Name" = Parent)
  • Look up Objects from Services -
    • Name = "Parent"
  • Then edit issue - advanced with the above

This then gives everything you need in the final call :)

Final result is whatever the user inputs into the Insight - Services custom field plus the parent of those services as well.

0 votes
Simmo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 11, 2022

Hi @andrew_pass

Could you provide a screenshot of the rule and what you have so far?

Cheers,

Simeon. 

andrew_pass
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 13, 2022

Hi Simeon,

Thanks for getting back to me, gonna need to type this long hand as for some reason upload isn't working.

Trigger - When value changes for Affected Services

Action - Log value to audit log - {{issue.affectedServices}}

Action - Lookup objects 

  • From Services
  • Query - object HAVING inboundReferences("Name" = X)

Branch Rule on IQL

  • Object HAVING inboundReferences("Name" = X)
    • Then: Edit issue fields
      • Advanced -
{
"update": {
"Affected services" :
[{"set":[
{{#lookupObjects}}
{"id":"{{Service.Service ID}}"}
{{^last}}, {{/}}
{{/}}
]
}]
}
}

I've tried loads of different permutations for the last bit based on some posts and guides I've found.

Effectively all I want to do is append the Service with Name X to whatever is already in the Affected Services list. 

The logic on the branch and IQL is working as it also injects the value for into another custom Insight field but I need it in Affected Services as well so it gives visibility on other changes / incidents.

Hopefully makes sense? Root of the problem is that you can't just add additional values to the field via automation like you can on others like labels.

Thanks!

Andy

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events