Including Jira ID into User Object in JSM Assets

Stephen Call November 25, 2024

Hello!

I'm looking to add the Atlassian ID to their respective JSM Asset object attribute associated with the User objects. We have created an automation rule that mirrors the one outlined here: https://confluence.atlassian.com/jirakb/update-user-type-attribute-of-an-insight-objects-using-automation-after-import-1141505554.html

We are finding that we are unable to enter the 'Name' attribute as a valid entry for the 'Atlassian Account ID', even though we have confirmed that we are able to COPY and PASTE the 'Name' attribute, and have it return properly with only one entry into the 'Atlassian Account ID' dropdown.

 

Attribute value is not valid on Objects
PEOP-xx (Atlassian Account ID = xx)
Error updating Object(s)

If anyone has any suggestions on next steps to get the Atlassian ID into JSM Assets would be greatly appreciated.

Thank you!

Stephen

1 answer

1 vote
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 25, 2024

Hello @Stephen Call 

Welcome to the Atlassian community.

Can you provide a screen image showing the details of the step where you are trying to Edit the Asset fields and use the Name attribute?

The article you referenced does not include instructions about using the Name attribute, so I am suspecting you have not created your rule in the same manner as instructed in the article.

Stephen Call November 26, 2024

Hello Trudy, 

Thanks for responding so quickly!

Please see below for your requested screenshot. Note that the slight adjustments I made to the naming convention was due to how our specific instance is configured. 

If you would like to see anything else, or have a suggestion on where to investigate first, it would be greatly appreciated.

Screenshot 2024-11-26 080816.png

Thanks again!

Stephen

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 26, 2024

Thank you for the additional information.

Can you provide the details of each step in the rule?

Please also use the Log action to print to the rule audit log the smart values that you are trying to use which should be (according to the referenced article):

{{object.mail}}  (or the name you have given to the "mail" attribute in the People object)

{{webResponse.body.accountId}}

 

Can you show us a screen image of the People object attributes showing the Atlassian Account ID attribute type, specifically?

Stephen Call November 26, 2024

Please see below for an outline of the automation rule, let me know if you need validation screenshots of any specific configurations mentioned.

When updating an object within the 'People' object schema, the AQL: 'Email is not empty and "Atlassian Account ID" is empty' is ran.


A new variable named EMAIL is created with the smart value: {{object.Email}}


A web request is sent to https://<Jira Sandbox>-sandbox.atlassian.net/rest/api/3/user/search?query={{EMAIL.urlEncode}} with a GET request with the following headers:

Content-Type - application/json

Accept - application/json

Authorization - Basic <API Key>


Another new variable is created named AAIDUser with the smart value: {{webResponse.body.accountId}}


We finally edit the object attribute of 'Atlassian Account ID' with the smart value: {{AAIDUser}}

Below is the requested screenshot, along with a screenshot of the resulting audit log entry:

Attributes.png

Log.png

 

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 26, 2024

I see that the Edit Assets output in the log is listing 50 objects. I think you are running into the problem in the blue Note at the bottom of the article.

Note

In cases where you have more than 50 objects to update the user-type attribute, it can happen that some of your objects do not have a corresponding Jira user on your site. Due to the limit of branch that can take atmost 50 objects, it can happen that no new objects are picked by the branch as "Jira user" remains empty for these objects. ...

Try implementing the solution mentioned in the rest of that Note to see if that helps.

Stephen Call December 2, 2024

Hello Trudy,

Thank you for the additional feedback, it seems that we are still running into the same issue even with the additional note from the bottom of the KB article here: How to update user type attribute of an Asset objects using Automation after Import.

I'm finding that all objects are being skipped when attempting to populate the 'Atlassian Account ID' attribute using the automation rule; and I can confirm that when manually populating the field, I am able to get the expected result from the dropdown list.

Are there any additional steps we need to add into the automation rule to validate that enough time is being given for the 'Atlassian Account ID' attribute to properly populate?

Let me know if you require any additional information or screenshots to validate any of the information above.

Thank you for any additional information you can provide!

Stephen

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 4, 2024

Hello Stephen,

So, to be clear, you implemented the changes from the note at the bottom of the article?

  1. You added the Last Sync Date attribute to your User object.
  2. You update the AQL in the rule.
  3. You updated the Edit Object action to set the Last Sync Date attribute

I'm finding that all objects are being skipped when attempting to populate the 'Atlassian Account ID' attribute using the automation rule; 

If you have many User objects to update, you may need to run the rule multiple times to get through all the objects for which the email in the object does not match the email of any user in your system. The branch will process only 50 items each time the rule is run. For the first 50 objects where Last Sync Date is empty, it should try to find the matching user, update the User attribute if a match is found, then update Last Sync Date. The next time the rule is run it will process the next 50 objects, and so on.

and I can confirm that when manually populating the field, I am able to get the expected result from the dropdown list.

Have you accessed one of the objects listed in the rule Audit Log as failing to update, looked at the email in that object, and checked if an active, licensed user exists in your instance for that email, and confirmed you can manually set the User attribute to that user for that object?

 

Can you also add a Log action to your rule to print the value of {{AAIDUser}} to the rule Audit Log to confirm that the variable has a value. That will help us confirm if they web request is finding a User account that matches the Email in the object.

Stephen Call December 4, 2024

Hello Trudy,

I can confirm that we had added the 'Last Sync Date' attribute to the User object, as well as updated the AQL used in the rule. We are seeing successful 'Last Sync Date' values being set, but with no User attribute populated.

Have you accessed one of the objects listed in the rule Audit Log as failing to update, looked at the email in that object, and checked if an active, licensed user exists in your instance for that email, and confirmed you can manually set the User attribute to that user for that object?

Yes, I can confirm that the users that I would expect to see are active, licensed users. Additionally, I can confirm that the email address is populating as expected in the log action for the automation rule. (I did not provide a screenshot due to confidentiality of user information, but let me know if you would like to see this confirmed in a different way.

Please see the attached screenshot for confirmation of the Username attribute functionality:

Screenshot2 (2).png

Thanks again!

Stephen

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 4, 2024

Thank you for that additional information.

Did you also...?

add a Log action to your rule to print the value of {{AAIDUser}} to the rule Audit Log to confirm that the variable has a value. That will help us confirm if they web request is finding a User account that matches the Email in the object.

We need to confirm that the web request is finding the user account based on the email provided.

 

In the image you shared of the object, is that an object that was selected when the rule executed but did not get its Atlassian Account ID field updated?

 

Who is the Actor for the rule?

Stephen Call December 4, 2024

Hello Trudy,

I can confirm that there is a successful log action that (I believe) is capturing the {{AAIDUser}} value, please see the partial export of the log received from our latest attempt. (There were a total of 50 objects that were skipped from this run attempt, I just reduced the example below for your review.)

I can confirm that the screenshot previously provided was the first entry, which was unable to find the Atlassian Username entry.


Action details:
Send web request
Successfully published web request

Edit Assets field attributes
Objects were skipped
PEOP-101503 (Atlassian Account ID = ''), PEOP-101996 (Atlassian Account ID = ''), 

Objects successfully updated
PEOP-101503 (Last Sync Date = 04/Dec/24 ), PEOP-101996 (Last Sync Date = 04/Dec/24 )

Log action
arehm@xx.org , absingh@xx.org


Thank you,

Stephen

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 4, 2024

Hello Stephen,

Thank you for your patience as I try to help you debug this.

In the same that you provided I don't see anything that I would expect represents a Log action for the {{AAIDUser}} variable. The value would be something alphanumeric like these:

5dedss3bccc48a0af529efa0

729184:12345ss3bccc48a0af529efa0

If the web request is able to find an Atlassian Cloud user that has the Email address from the Object, then the accountId attribute should give you a value similar to the ones above. You can find the same value for a user by looking up the user through the Teams feature in Jira. When you then select the user record, the account ID will show in the URL.

Looking at the sample output you provided, it seems like for PEOP-101503 the value of Email is not finding a corresponding Atlassian Cloud user account because it is showing no value in those lines that say Atlassian Account ID = ''

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events