Copy Jira user from Assets object attribute into assignee field via automation

Konstantin Weber - SVA December 8, 2022

Hello fellow Atlassians,

I'm trying to implement a substitute regulation in case the assignee or approver of an issue is out-of-office and would therefore like to change the assignee of an issue via a scheduled Automation which JQL-selects issues that haven't been updated in the last three business days.

Since we're doing this escalation along the hierarchy, we're using Assets to use the referencing of deputy/substitute or manager of our users. Every user is represented by an object which is imported from the AD. During import, we're matching the CN to fill in the Jira user attribute of each object/user. 

Not being able to use {{lookupObjects}} in Automation (we're on DC) got me to using an Assets custom field, which gets auto-populated with the referenced (user-)object of the current assignees Assets object via assign issue scope. Let's call this field "Manager of assignee" or "customfield_11301". The (user-)object displayed in the field "Manager of assignee" also has its corresponding Jira user filled in as attribute "JiraUser" like any other user with Jira account too.

The Automation will run scheduled and check a JQL statement as described. Then it should edit the issues assignee via a smart value, but I cannot figure out how to do so.

Result is, that the issue gets unassigned and the "Manager of assignee" field cleared respectively.

I tried different smart values, the most logical to me is {{customfield_11301.JiraUser}}

2022-12-07-15_31_59-assignuser.png

I tested the automation with two accounts which do have admin permissions in the project, because we're also using an issue security scheme within the project. One account is deputy of the other one, who is assignee of the ticket. But still no success. The Automation rule states SUCCESS and does not give any information on why it is not working.

Is there an attribute missing in the Assets dot-notation or do you see any other mistake I made? Maybe someone even implemented a substitution automation in another way...

Best regards
Konstantin

 

3 answers

1 accepted

0 votes
Answer accepted
Maksim Marholin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 11, 2022

Hi @Konstantin Weber - SVA ,

I would suggest to reach out to Atlassian Support, as it's hard to tell why things are not working for you without looking into details.

Best regards,

Maksim

Konstantin Weber - SVA December 12, 2022

Hi Maksim,

since Atlassian Assets on premise is only supporting getting the key or summary (label) of an asset via Automation, I had to change the label of the employee object to the CN, which is also used for usernames in the instance. This way I could Automation to parse the {{customfield_11301.summary}} (object label and username) into the field assignee and by thus change its picked user.

Edgar Koenig - SVA December 12, 2022

Hi Konstantin,

you are right. Atlassian Asset on DC only supports summary and key. It is mentioned in this Smart Values article for Insight objects: https://confluence.atlassian.com/automation/jira-smart-values-issues-993924860.html.

After the takeover, Atlassian probably didn't change anything.

Like Konstantin Weber - SVA likes this
1 vote
Jörn Donneau December 20, 2022

Hey @Konstantin Weber - SVA there is a post function called "Assets post function" where you can copy a value from an Assets object custom field to a Jira field of the same type, e.g. user picker or maybe it even works with as Assets object field).

You could use this to populate the Jira issue field and then run your scheduled automation on this field?

0 votes
Hieu
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.
December 25, 2022

Script listener can help you in this case.

We can extract data from insight object, then get the value of specific attribute then pass it to the assignee of the current issue.


Suggest an answer

Log in or Sign up to answer