JIRA automation smart value for project lead - issue.project.lead - is null

Kyle Quevillon February 5, 2021

I am just getting started using JIRA automation for JIRA Premium in the cloud.

I would like to be able to automatically set the assignee for an issue upon specific transition to the project lead and to email that project lead.

However, looking at the smartvalue for {{issue.project.lead}} in a debug rule I set up, those values are null, even though my project has a lead set (me for my test project) and they have email addresses set up in their profile.  (of course all projects have it as a required field).

Any help?  I'd like to be able to access who is the project lead for any issue and be able to assign them, email them and possibly tag them in a new comment, set them as a watcher etc, in different circumstances/rules that I may make.

4 answers

1 accepted

0 votes
Answer accepted
Ravi Sagar _Sparxsys_
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 5, 2021

Hi @Kyle Quevillon @Kian Stack Mumo Systems 

I can also confirm that {{issue.project.lead}} is indeed null.

If this is blocking you then while Atlassian fixes it may be use this method to get the lead using REST API.

Send a web request.

JIRAURL/rest/api/3/project/{{issue.project.key}}

Make sure to check "Delay execution of subsequent rule actions until we've received a response for this webhook".

Then in the next component you can access lead information using:

 {{webhookResponse.body.lead.displayName}}

Not ideal way of doing it but I thought it might be useful.

Ravi

Robert Horan
Solutions Partner
Solution Partners provide consulting, sales, and technical services on Atlassian products.
April 15, 2021

I just used {{issue.project.lead}} in a rule to assign issues to the project lead and it worked just fine as far as I can tell.

Mykenna Cepek
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.
May 3, 2021

Seems to also be working for me. This is with a Company-Managed (aka Classic) Project in Jira Cloud Premium:

Screen Shot 2021-05-03 at 11.56.22 AM.png

0 votes
Mermaidcoder May 22, 2024

@Mykenna Cepek  I am a few months late, but I tried all the solutions above and nothing worked. I am attaching also some screens. As you can see I tried both
{{issue.project.lead.emailAddress}} and {{issue.project.lead}} and both are empty.Screenshot_4.pngScreenshot_12.png

0 votes
Boris Berenberg - Modus Create November 22, 2022

Notification Assistant for Jira supports Project Lead as an out of the box Recipient:

Google Chrome 2022-11-22 at 16.07.53.png

0 votes
Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2021

@Kyle Quevillon

I'm seeing similar behavior. I set up an automation rule to pull the value from project lead and cannot get it to work either. When I did a bit of digging,  I found out that when you use the smart value {{issue.project}} it's pulling a JSON-like object that looks like this:


Project{
self='https://jiraservicemtesting.atlassian.net/rest/api/2/project/10012',
id=10012, key='SP',
name='Software Project',
description='null',
avatarUrls={48x48=https://jiraservicemtesting.atlassian.net/secure/projectavatar?pid=10012&avatarId=10419, 24x24=https://jiraservicemtesting.atlassian.net/secure/projectavatar?size=small&s=small&pid=10012&avatarId=10419, 16x16=https://jiraservicemtesting.atlassian.net/secure/projectavatar?size=xsmall&s=xsmall&pid=10012&avatarId=10419, 32x32=https://jiraservicemtesting.atlassian.net/secure/projectavatar?size=medium&s=medium&pid=10012&avatarId=10419},
issuetypes=null,
projectCategory=null,
email='null',
lead=null,
components=null,
versions=null,
projectTypeKey='software',
simplified='false'}

 

What's odd about this is that I have a lead for the project, and I've set a description. It appears that the object they are returning for "Project" may not be keeping up to date. I don't know if this is a "bug" as I actually can't find any references to using the project object in Atlassian's documentation, but it certainly seems like it should be working and it isn't.

Kyle Quevillon February 5, 2021

@Kian Stack Mumo Systems exactly what I am seeing when I dump the project object.
I have seen another post out there where someone asks how to get the project lead's email address in order to send them an email and the suggestion is to use {{issue.project.lead.emailAddress}} and I believe they said that worked for them, but I don't know how it could is the lead property is null.

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2021

@Kyle Quevillon, the documentation for the server version of Automation for Jira explicitly references the project object, so it's possible that the server version supports it and the cloud does not... That being said, the fact that I can access it makes me think that it IS supported and just not functioning correctly.

I would log a bug with Atlassian support if I were you, and tell them that the project object is not returning the correct data.

Like Mykenna Cepek likes this
Laura Meine November 22, 2022

Was there ever a solution to this for a Cloud install? I have an automation rule to send a notification to the project lead anytime a new ticket is created.  The log shows an error when sending the email and I assume it's due to this same issue.

 

"Could not send email, the 'To' address field is empty. If you have referenced a field it may be empty."

2022-11-22 09_39_13-Clipboard.png

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 22, 2022

@Laura Meine, did you already try the other solutions mentioned above?

Laura Meine November 22, 2022

Hi Kian,

 

Thanks for responding.  I'm trying the web request, but I'm very new to this.

Would you be able to confirm a couple of things?

1) what should be in the web request body?  I assume the rest of this is correct (with HTTP method = GET).

web_request.png

 

2)  In my next component, I want to send the email to the project lead, so, that component would need to be different from the example here ({{webhookResponse.body.lead.displayName}}), but I'm not familiar with how I can find what values are possible.
 

I really appreciate any help or direction you can provide.  This community has been so helpful!  Such a blessing.

Kerrod Williams _M20_
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 6, 2023

Hi @Laura Meine,

I know I'm a few months late -- if you're trying to send an email to the project lead, then {{issue.project.lead.emailAddress}} should work for what you need here.

Like # people like this
Mykenna Cepek
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, 2023

@Kerrod Williams _M20_ - thanks for pointing out that SmartValue!

Other helpful data in user records in Smart Values:

  • active - whether the user's account is active or not
  • displayName - the full name in the user's profile
  • name - the username in the user's profile (aka userID)
  • timeZone - the time zone based on the location set in the user's profile

Documentation for Server/Data Center and for Cloud.

Laura Meine March 29, 2023

@Kerrod Williams _M20_ you are my hero!!!  I finally got to get back to this and it works perfectly.  I can't thank you enough.

David Griffin February 20, 2024

Yes, thanks @Kerrod Williams _M20_ . That option also worked for me

Suggest an answer

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

Atlassian Community Events