{{initiator.displayName}} return empty on commit trigger

Utku Demir
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!
June 25, 2022

We are using GitHub app for Jira Cloud and automations for commits&PR's. I'm using "When a commit is made → then move issue to in progress" automation rule. Also I want to add user condition for "user who triggered event" is equal to "issue assignee" but unfortunately automation fails at user condition with "The following issues did not match the condition". I tried to debug automation rule with Slack message(first thing come to my mind) by sending {{initiator.displayName}} and {{assignee.displayName}} but the initiator always returns empty. So what can be the issue here that I'm missing ?

1 answer

1 accepted

2 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 Leaders.
June 26, 2022

Hi @Utku Demir -- Welcome to the Atlassian Community!

When you commit from some tool outside of Jira, it does not have the same user information, and so the {{initiator}} cannot be a Jira User.

There are open suggestions to improve the DevOps triggers to pass more information, such as the commit's author: https://codebarrel.atlassian.net/browse/AUT-1997 and https://jira.atlassian.com/browse/JSWCLOUD-21908

Until these are improved, perhaps a work-around could be to use the commit information and call the GitHub REST API from an automation rule web request to get the author information, and then try to get the user information using the Jira REST API.  I do not know if that last part is possible after the GDPR changes (i.e. looking up a user from their email address).

Kind regards,
Bill

Utku Demir
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!
June 26, 2022

I see, thanks for the answer.

So until Jira give full support official GitHub app for automations maybe only way to achieve these kind of conditions is to use informations come with the api.

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.
June 26, 2022

Yes, and...even within Jira there are things that are not directly possible from automation rule actions.  Using web requests to call the Jira (and other) REST APIs can help fill in those feature gaps.  To learn more about calling a REST API from a rule, please see this article:

https://community.atlassian.com/t5/Jira-articles/Automation-for-Jira-Send-web-request-using-Jira-REST-API/ba-p/1443828

Suggest an answer

Log in or Sign up to answer