The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

[Automation] Problems with accessing root data for "webhookData" from list

pavlova_iryna
December 9, 2021

Hi,

I am trying to setup a webhook for Git pipelines and post their status in MTeams chat. My problem happens when I iterate through list of "builds" and try to access parent value.

{{webhookData.project.web_url}} WORKS

{{#webhookData.builds}}
{{webhookData.project.web_url}} DOES NOT WORK
{{/}}

 Is it a bug? Or am I doing something wrong?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
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 Champions.
December 9, 2021

Hi @pavlova_iryna 

When you note this "does not work", what are you observing?  What is in the audit log for the rule?

And when you iterate over the values in a list that way, you do not repeat the top-level: just the child attributes.  For example (and I have not tested this as I do not know the response data structure):

{{#webhookData.builds}}
{{project.web_url}}
{{/}}

You may want to log all of the webhookData to see what the structure actually contains.

Kind regards,
Bill

pavlova_iryna
December 9, 2021

Hi @Bill Sheboy ,

The structure is definitely correct. I additionally verified it with the "Log" action.

Your example references an element in list iteration, which should be with the full name as:

{{webhookData.builds.project.web_url}}

 But I need precisely a property one level upper.

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 Champions.
December 9, 2021

What I was describing was when you use a list iterator with smart values, only the child attributes (smart values) are referenced.  Please see this documentation for examples with issue fields: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-lists/#Combined-function-examples

You note the structure is correct, so if the iterator is not working I suggest working with your site admin to submit a ticket to Atlassian support for assistance.  Your team can do that if you are are on a paid license of Jira: https://support.atlassian.com/contact/#/

pavlova_iryna
December 9, 2021

Ah, I see it now. Thanks a lot for the clarification!

TAGS
AUG Leaders

Atlassian Community Events