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.
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Seems to also be working for me. This is with a Company-Managed (aka Classic) Project in Jira Cloud Premium:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Laura Meine, did you already try the other solutions mentioned above?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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).
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kerrod Williams _M20_ - thanks for pointing out that SmartValue!
Other helpful data in user records in Smart Values:
Documentation for Server/Data Center and for Cloud.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.