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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,358
Community Members
 
Community Events
185
Community Groups

Automation rule on referenced Insight objects

On my issue type, I created a custom field to reference Insight objects.

When I update that issue field (when I add a reference to an Insight object) I want to automate the value of an attribute of the referenced Insight object.

My Insight object has an attribute called "Stock" and I would like to update that value to its own value, minus 1.

That is : my Insight object has a "Stock" value of 10. When I reference this object on my issue, I want to update that stock value to 10-1 (9).

image.png

The automation rule gets triggered, but the value of Stock becomes -1 instead of 9. I bet the problem is with "object.Stock". What am I doing wrong?

2 answers

1 accepted

1 vote
Answer accepted

For the sake of completion, with the help of Atlassian support, I was able to generate the rule. I needed a Global Automation rule with the following settings:

  • When: Field value changed
    • Fields to monitor for changes: [Insight object field] 
    • Change type: Value added
  • Then: Create variable
    • Variable name: addedValues
    • Smart value: {{#addedfieldChange.values}}"{{.}}"{{^last}},{{/}}{{/}}
  • Branch on IQL
    • Schema: [Insight object schema]
    • Query: Name IN ({{addedValues}})
  • Then: Create variable
    • Variable name: stock
    • Smart value: {{object.Stock}}
  • And: Edit object attributes
    • Attribute: Stock
    • Value: {{#=}}{{stock}} - 1{{/}}

I created a reverse rule to increment the Stock value by 1 when an Insight object is removed from my field as well. It is basically the same rule but with {{#deletedfieldChange.values}} when "Change type" is "Value deleted".

It works as expected, when one (or more) Insight object(s) are added/removed from the field.

Hello @Arnaud Marquis 

saw your thread after I was looking for a solution to use the content of fields within object change triggers in insight.

Unfortunately, neither "When: Field value changed" nor "Then: Create variable" exists as options in the automation rules I can define.

2022-10-14 18_50_19-Insight - Athlon JIRA – Mozilla Firefox.png

What am I missing here?

0 votes
Gaurav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 26, 2022

Hello @Arnaud Marquis 

This is an interesting use case. I have done something similar previously, but I was mainly extracting the data from the Insight schemas.

Looking at the rule, I think it is not able to point/ gather the exact 'Stock'. So the question is stock for what?

I believe you would have some other Custom Field where you would be storing the item whose stock would need to be depleted. Replace the word 'object' with that field name and try. It should work.

Please find below the screenshot of my implementation. Kindly accept the answer if this helps.

Regards,

GG

Insight Object.png

@Gaurav thanks for your answer.

So the question is stock for what? - Stock (which is a custom Insight object attribute) of that specific referenced object. As I said, it "works" as it updates the stock value of the Insight object I am after. Just not with the right value.

I believe you would have some other Custom Field where you would be storing the item whose stock would need to be depleted. Replace the word 'object' with that field name and try. - No, there is no additional custom field. Just the attribute.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events