Forums

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

Automation - Interact only with the new added/removed components

Gabriel Chaves September 28, 2023

Hello,

I would like to create a rule to add a comment every time a new component is added or removed.

First I created like this:

img01.png

But the Jira allows the user add multiple components at once, and the automation add a comment only for the first one.

I tried the 'for each' but I got a comment for all the components, I want only for the added or removed.

 

Any thoguths? 

1 answer

1 accepted

0 votes
Answer accepted
Gabriel Chaves October 2, 2023

Hello I found a solution for my problem.

Created separeted rules (easier for now)

1. Create a variable to receive the new values for the field components:

{{#changelog.component}}'{{toString}}', {{/}}

2. Add a replace function to remove the empty items (this happens because the person can add and remove items in the same action) and substringBeforeLast to remove the last comma.

{{updatedComponents.replace("'',","").substringBeforeLast(",")}} component(s) added by {{initiator.displayName}}.

NOTE>

toString when I want to check the new items added;

fromString when I want to check the new items added;

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events