How to copy Jira users from text attribute to user attribute using an Assets automation

Platform Notice: Cloud, Server, and Data Center - This article applies equally to all platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

This article applies to the scenario where the Assets objects have a text attribute populated with Jira usernames and we want to copy those over to an attribute of type user in the same object type, for example in order for the related objects to be displayed in each user profile.

Problem

Some of the users maintain the username in the Assets object stored in a text field attribute. As this is a Text type attribute ( and not the User type attribute), these objects will not be associated with the user and hence not displayed on the user profile of Jira user.

Solution

From an Assets point of view, the only way to associate an Object to a Jira User is by using a Jira User type Attribute (a User Picker) on the Object. In this use case, as the user is using Text type attribute, the objects will not get displayed on the Users profile. Therefore in order to get the objects displayed on profiles, it is necessary to add a new User type attribute to the same object type and use an Assets automation to update the Jira User type attribute by copying over it the value of the text attribute that contains the username as follows:

  • Add a new User type attribute to the existing object type: 
  • Add an automation rule to go through all the objects with the non-empty Text User attribute and update the attribute Jira User with the same value. This automation is run once to update all the existing objects. In order to address the scenario where the the value of the Text type attribute attribute changes in the future, we will need to add another event-based automation (with a similar THEN structure) for create/update events to update the User type attribute from the modified Text type attribute. Note that a placeholder is used in the Action of the automation to explicit the value of the Text attribute:





Last modified on Sep 26, 2023

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.