Forums

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

Automation to pull members of an Assets Object Attribute and e-mail

Chad Jackson
Contributor
March 23, 2023

In this example I am trying to pull the Users in the Manager Attribute  which is of Type User. My thought is I should be able to pull the User ID  into a variable and then send an e-mail using the variable. I have tried several ways of pulling the Account ID and so far have not been able to get any info from the Type User.

 

2023_03_23_09_03_42_Assets_Object_Jira.png

 

2023_03_23_12_47_13_Assets_Object_Schema_Jira.png2023_03_23_09_09_20_Automation_Jira.png

 

Although I am able to acquire what i need from the Member Attribute Type Object . Due to Label Value I am not able to search or display the value I would like. Changing the Label Value is not an option. 

 

2023_03_23_13_01_35_Automation_Jira.png

Any assistance with the ability to gather the User in the Manager Attribute would be greatly appreciated.

 

Thank you

3 answers

2 accepted

1 vote
Answer accepted
Chad Jackson
Contributor
April 3, 2023

So the issue of not being able to return values from  Type User was due to a lack of permissions. To provide a bit of context, a user value returning unknown user means that the user that is running the rule does not have the Browse Users and Groups global permission.

Our automations are using the "Automation for Jira" Account and it did not have Browse Users and Groups permissions. The user Automation for Jira only belongs to the group "atlassian-addons-admin", as such our automations account lacked the ability to find user data from the account id/display name that is stored in the user attribute in assets.

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.
April 3, 2023

That is interesting and useful information; thanks!

0 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.
March 23, 2023

Hi @Chad Jackson 

Would you please show what is appearing in the log details after you try those writes?  Knowing that may help the community come up with suggestions.  Thanks!

Kind regards,
Bill

Chad Jackson
Contributor
March 24, 2023

The best I get is this []  an empty value

 

I have tried several options only to return nothing. This has been the most promising article I have found. It's also the article Atlassian support sent my way. Although every iteration attempted has returned and empty value

https://confluence.atlassian.com/jirakb/auto-populate-approvers-from-insight-objects-1072474097.html

 

{{lookupObjects.Manager.flatten.asJsonObjectArray("id")}}  

{{lookupObjects.Manager.Jira user.accountId}}

{{lookupObjects.Manager.Jira user.accountId.get(0)}}

Like Soporte Itera 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.
March 25, 2023

Lookup Objects returns a list of things, and so first try accessing one item:

{{lookObjects.first.Manager.Jira user.accountId}}

Or the list of values like this

{{#lookObjects}}{{Manager.Jira user.accountId}}{{^last}}, {{/}}{{/}}

If that does not work, you may not have the correct smart values.  Those are name, spacing, and case-sensitive, so perhaps try this how-to article to confirm the smart values: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Chad Jackson
Contributor
March 27, 2023

Appreciate the help Bill, I still am not able to pull anything in to the logs for User Attribute Manager. But when using Object Attribute Member I am able to pull everything needed in.

Hope this explains it a little better, I am clearly missing something. I suspect its with how User reads a variable vs an Object

 

1: Eport from the IT Tools Team Object, Manager exports as First Name Last Name||   I was expecting an IDTeam Export.png

2: Showing the team with multiple users in each attribute 

Team Object.png

3: Showing the Team Attributes

Team Attribute.png

 

4: Automation being ran

  • on create trigger
  • Validate the Service field is not empty ... We are trying to auto assign based on a support team defined for each service
  • Create variable AutoTeam {{"customfield_11961"."Level 1 Support"}}
  • Edit issue field AutoTeam with variable output (IT Tools Team) in this case
  • LookupObjects to search the Team Object of AutoTeam objectTypeId = 29 AND Name = "{{AutoTeam}}"
  • Add Value to the audit log to validate who will be sent an e-mail
  • Create variable with that value (EmailTeam)
  • Send e-mail via that variable 

Working Member Automation.png

0 votes
Chad Jackson
Contributor
March 27, 2023

Here is what was received by Atlassian support.

 

Anchal Chopra commented:

Hi Chad,

Thanks for the update!

After further troubleshooting, I am afraid, I found that we can't fetch the email address from a user-type attribute in Assets via Automation using smart values in order to use it in the "Send email" action due to the below bug:

At the moment, only accountId and displayName are returning results on Assets user attribute smart values.  

We encourage you to add yourself as a watcher to be kept informed as to the state of the bug moving forward. That way, if the ticket is updated by our development team, you'll be notified via email. We have also added an internal note on the bug ticket referencing your case. You can also add a comment to the bug ticket to explain your specific use case to the product managers and the development team.

There are a number of factors that determine how Atlassian prioritizes bug fixes. You can learn more about this by reading our Atlassian Cloud Bug Fixing Policy.

As a workaround, as mentioned in the bug, you can create a separate text attribute in Insight to store the email address of the user and use that attribute to get the value. Sorry for the inconvenience.

On a side note, the shared smart value "lookupObjects.Manager.flatten.asJsonObjectArray("id")" would return the ids of the attributes that are used to update the Approver fields. In your case, adding a "Re-fetch Issue data" action after "lookup objects" would help fetch the refreshed value of the field. However, this won't help to send the email to the required Managers in the Assets objects.

Let me know if you have any queries I can help with. I'll be here to help.

Regards,
Anchal

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