Forums

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

working with arrays in Jira automation

Yahyaa Bham July 3, 2023

Hi, 

 

Im looking to update a Jira issue when a new joiners start date is changed in the HRIS. I have a webhook that goes into Jira whenever an employees record is changed. My approach is to:

  1. filter if its actually a profile update
  2. filter by updates to start date
  3. take the new start date and use this to update the jira issue

my issue is that the response comes in as an array and Im not too sure how to extract the info. Example: 

{
"companyId": 123,
"employee": {
"id": "321",
"companyId": 123,
"firstName": "bob",
"surname": "bob",
"email": "bob",
"displayName": "bob bob",
"site": "London",
"siteId": 456
},
"changedBy": {
"id": "123",
"companyId": 456,
"firstName": "bella",
"surname": "bellllllla",
"email": "bella",
"displayName": "Bella",
"site": "London",
"siteId": 2123
},
"type": "employee.updated",
"data": {
"fieldUpdates": [
{
"path": "/work/activeEffectiveDate",
"originalValue": "2023-05-30",
"newValue": "2023-07-01"
},
{
"path": "/work/customColumns/column_1673975628811",
"originalValue": "255135210",
"newValue": "255135209"
}
]
},
"previous": null,
"creationDate": "2023-06-30T23:07:00.93048"
}

 

Im trying to filter by {{webhookData.fieldUpdates.path}} = /work/activeEffectiveDate
if true

take {{webhookData.newValue}}

I dont know how to arrange this in the ui. 

 

To add, the path /work/activeEffectiveDate may not always be the first object :) 

1 answer

2 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.
July 3, 2023

Hi @Yahyaa Bham -- Welcome to the Atlassian Community!

Do you get a rule trigger for each update, or do you get several in a batch?

I believe there are at least two ways to solve this, based on your answer to above...

Kind regards,
Bill

Yahyaa Bham July 4, 2023

I get a rule trigger for each batch of updates per user.

 

I will give list filtering a go, I haven't used these before so will need to wrap my head around it.

Ill also potentially combine with a series of conditions.

Thanks! 

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events