Automation : How to send an email to an Asset object

Mario GELES
Contributor
October 20, 2023

Hi community, 

I need a little bit help for an automation with asset and smart value. I think it's basic but I am new in automations with asset. 

So I have an ObjectSchema called "Organisation" in this there is an ObjectType called "Fournisseurs" wich contains an Object called "Toto". The Toto attribute called "Courriel" is the email address of Toto

In my issue I have an asset customfield called "Fournisseur" that allow the assigne of the issue to select one object in the ObjectType "Fournisseurs". 

I want to send an email of the Object selected in the field "Fournisseur" (Toto in this example).

I am facing two problems. 

First the AQL request in lookupObject can't find the object : 

Lookup_Object_request.png

And second problem if I replace "{{issue.Fournisseur}}" by "Toto" (the value in the customfield Fournisseur). The object is found but Automation failed to get the value of the attribute "Courriel".

Lookup_Object_Attribute_Courriel.png

Here is the log : 

Automation_Error_Log.png

I use a lookup syntax found here : https://support.atlassian.com/cloud-automation/docs/jira-smart-values-insight/#SmartvaluesInsight-Lookupobjects

Bonus question : Is it possible to add issue attached filed in the mail send by automation ? 

Sorry for this very long message and thank you for your help :)

1 answer

1 accepted

0 votes
Answer accepted
Tom Lister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 20, 2023

Hi @Mario GELES 

For your lookup try the syntax as

(lookupObjects. (Courriel)})

Mario GELES
Contributor
October 20, 2023

Hi @Tom Lister ,

I tried it and it doesn't work.

The log say that it was impossible to send the mail because the "To" field was empty. 

Error_Log_Tom_solution.png

Tom Lister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 20, 2023

Hi @Mario GELES 

Could you add some log actions to your workflow to see the direct output of the syntax?

There are some other examples here

https://community.atlassian.com/t5/Jira-Service-Management/Using-automation-how-do-I-lookup-an-Asset-attribute-value-use/qaq-p/2365382

Like Bill Sheboy likes this
Mario GELES
Contributor
October 20, 2023

@Tom Lister 

As you said I add some log actions and it seems that the lookupObjects doesn't work, there is no value

Lookupobjects_failed_log.png

I forgot to mention that The objectType "Fournisseurs" is child of the ObjectType "Gestion" but when I create the customfield "Fournisseur" I didn't have to mention the parent ObjectType for my AQL to work. 

Maybe in automation it's mandatory ? 

Mario GELES
Contributor
October 26, 2023

Thank you @Tom Lister  with the help of the audit log I was able to resolve each problem one by one.

So the good AQL was : 

ObjectType=Fournisseurs AND Nom = "{{issue.customfield_10161.label}}"

 

And the proper way to call the attribute of my object was : 

{{lookupObjects.Courriel}}

 

Everything is working fine now. 

Like # people like this

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