Forums

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

Adding the Project Name into automation rule emails?

Graham Harbour
Contributor
June 23, 2020

Hi,

I'm setting up sprint start and completion emails in the Automation Rules function, and am successfully using the {{sprint.xxxx}] smart values to good effect - but I can't see anywhere in the documentation what smart value parameter I'd need to use to add the Project Name value into the email contents.

Is that even possible?  I'd like to do so to reduce the automation rules by a significant amount.

Thanks,

Graham Harbour

2 answers

2 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 23, 2020

Hi @Graham Harbour 

The value you want is:

{{issue.project.name}}

For stuff like this which is not listed in the Smart Value documentation, try this info to do a REST API call for an example issue:

https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/

Best regards,

Bill

Graham Harbour
Contributor
June 24, 2020

Thank you for your quick answer, Both {{project.name}} and {{issue.project.name}} worked for me.

 

A shame this wasn't clearly documented, but I guess there are limits to what you can publish in help files.

Like Bill Sheboy likes this
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 24, 2020

Yup, on the documentation.  After Atlassian acquired Code Barrel in November 2019, the latter's documentation was replaced by the former's info.  They are still catching up, I think, on making all that great information visible.

__Bill

Graham Harbour
Contributor
September 23, 2020

@Bill SheboyApologies for the follow-up message, but do you know if Atlassian have changed something?  None of the solutions in this answered query work for me now:

{{issue.project}}
{{issue.project.name}}
{{issue.project.displayName}}
{{project.name}}
0 votes
Answer accepted
John Funk
Community Champion
June 23, 2020

Hi Graham,

Have you tried using {{issue.project}} or {{issue.project.displayName}}

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.
September 23, 2020

Hi John and Graham,

I just tried what you tried, and my results were:

{{issue.project}} -- This one blows up with a long error message.  Interesting...
{{issue.project.name}} -- Returns the correct value
{{issue.project.displayName}} -- Returns nothing (null)
{{project.name}} -- Returns the correct value

 

Best regards,

Bill

Graham Harbour
Contributor
September 23, 2020

Hmm, how very odd - neither {{project.name}} or {{issue.project.name}} returns anything in the email subject line or body when used in automation rules with Sprint created or Sprint Completed triggers.

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.
September 23, 2020

Ah... Now I believe that I see what you are trying...

Those sprint triggers have no issue context, and the project name smart value comes from the issue.  So you would need an issue to access project name.

Maybe try the lookup action to get an issue, and then use that item to get the project name.

Graham Harbour
Contributor
September 23, 2020

Ahh, I understand.

I added a Then: Lookup issues sprint={{sprint.id}} in the rule to gather all issues in the sprint, then added {{lookupIssues.project.name}} into the email body.

That worked, thank you,

Graham

Like Inna S likes this
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.
September 23, 2020

Awesome!  I am glad that worked.

I am going to experiment with this a bit more using information from the REST API returns for sprints to see if there is an attribute/tag for the project in the sprint list.  It *seems* like there should be, but it does not seem to be working just yet.  ;^)

Update:

Nope, that does not work using what the REST API indicates *could* be attributes of a sprint smart value.  The API call used by the rules engine either does not have access or is not exposing the information.  Perhaps, one day, there will be more complete documentation (a data dictionary?) for the available smart values and their hierarchy structure.

Graham Harbour
Contributor
October 13, 2020

Hi.  Just a quick note to say my last solution worked - but only if I had 1 issue in the sprint to perform a lookup on.  In practice; with multiple issues in the sprint, using the {{lookupIssues.project.name}} value ends up displaying the project name in the automation email multiple times - once for every issue that is in the sprint :)

Close, but no cigar.  Hopefully your REST API experiments have yielded results.

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.
October 13, 2020

Hi, @Graham Harbour 

LookupIssues returns a list, so you could also just get the first value, regardless of the number of issues in the sprint:

{{lookupIssues.first().project.name}}

Regarding the REST API attempt, that did not work out.  Please see earlier response for details.

Best regards,

Bill

Like Inna S likes this
Graham Harbour
Contributor
October 14, 2020

Thank you, that worked.  A shame about the REST API - but thanks for investigating.

Like # people like 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