Forums

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

Edit issue automation for fixed in build with multiple projects

Vladimir Dabic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 21, 2022

Hi,

We are trying to implement an automation which would add or replace a fixed in build tag based on the project. It's important to note that we need to do it based on the project because there are some situations when one ticket affects multiple projects.

We are using JIRA webhooks in our Jenkins pipelines, and for every project we call a webhook with a version parameter which should be added (if the version tag for that project does not exist) or replaced (if tag with previous version is already defined). 

To achieve that we tried the following:

1. Defined smart value for every project in our edit issue automation

Screenshot_2.png

2. In project related Jenkins pipeline we define the webhook body, for example:

Project 1: {"issues":["DEVTEST2-1"], "aesFixedInBuild": "AES_6.1.3-123-RELEASE"} 

Project 2: {"issues":["DEV2TEST-1"], "epgFixedInBuild": "EPG_6.1.3-321-RELEASE"} 

 

The problem we encountered is that every time we trigger the webhook our automation adds the new tag instead of replacing the old one. So for example our fixedInBuild field looks like: Screenshot_3.png But, the desired behavior is:

 Screenshot_4.png

 

Is it possible to achieve this? Thanks in advance!

1 answer

0 votes
Bill Sheboy
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.
February 23, 2022

Hi @Vladimir Dabic -- Welcome to the Atlassian Community!

Looking at the piece of your rule you have included, you appear to be putting the webhook data values in the "Values to add" field for the field edit.  If that is correct that would explain why values are added and never replaced.

You have at least two options to try:

  1. Clear the field first with an edit, use a Re-fetch action to reload it, and then add the new values with a second edit
  2. Use an advanced edit with JSON to replace the values in one step (under the More options in the edit)

Kind regards,
Bill

Vladimir Dabic
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 24, 2022

Hi Bill,

Thanks for the response. I tried the first option but I can't figure out how to clear only one field and which field to clear. Since edit has multiple different fields (one field for every project as it can be seen on the first picture), and every time only one field is sent via webhook trigger (a project sends version info about itself only, fields for other projects are null so I can't clear all the fields and replace them with new ones). 

I can't get second option to work either.

Kind regards,

Vladimir

Bill Sheboy
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.
February 24, 2022

Hi, Vladimir.  Would you please clarify a bit to help consider solution approaches:

Are you using a global/multi-project scope automation rule, or in just one project?

Are you using Jira Cloud or Server/Data Center version?

If this is Jira Cloud, what type of project(s) are you using, Team-managed or Company-Managed?

You note "Since edit has multiple different fields (one field for every project as it can be seen on the first picture)".  Your image only shows *one* Jira field: Fixed in build.  So where are the multiple different fields?  Perhaps these are all team-managed projects and you have configured separate custom fields for each project.

Thanks,
Bill

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events