Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,459
Community Members
 
Community Events
184
Community Groups

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

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

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.
Apr 03, 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.
Mar 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

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)}}

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.
Mar 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/

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

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
Site Admin
TAGS
AUG Leaders

Atlassian Community Events