Forums

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

Question on Jira Assets automation

Bill Parlock
Contributor
October 17, 2024

I am using Jira Assets and would like to set up an automation rule when a new object is created. I am just having an issue with the syntax. I have an attribute 'Prepared By' that I would like to set to the current user if the object is created and there is no value for that attribute. The Prepared By type is User.  I have been setting the rule as follows :

When: Object created

If (condition): Prepared By = null

Then:  Action: Attribute Value

           Attribute Name: Prepared By

           Value: currentUser{}

Thanks.

 

2 answers

0 votes
Trudy Claspill
Community Champion
October 17, 2024

Hello @Bill Parlock 

What is the output in the rule execution log file?

Is the problem that your rule doesn't get past the condition, or that the attribute is not set to the expected user?

Bill Parlock
Contributor
October 22, 2024

Actually, both. I am doing testing where I removed the condition so when the object is created the 'Prepared By ' field would be populated. That would be the simple case. As another person has recommended, I am trying to use the {{initiator.displayName}} value to populate the field. So far though the field is not being populated. Once I get the field populated then I will try to add the condition, I need to check the execution file as you suggested.

0 votes
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.
October 17, 2024

Hi @Bill Parlock 

For the person / user who performed the action that triggered the rule, please use the {{initiator}} smart value: https://confluence.atlassian.com/automation/jira-smart-values-users-993924862.html

Kind regards,
Bill

Bill Parlock
Contributor
October 22, 2024

Thank you for the link. I am continuing with the {{initiator.displayName}} value. So far I have not been able to populate the field though.

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.
October 22, 2024

If that field is a user, please try using {{initiator.name}} instead.

Bill Parlock
Contributor
October 22, 2024

I have tried {{initiator.name}} and {{initiator.accountId}}.  Not successful though. From the log file:

' Error when updating object rlabs-insight-attribute-...   At least one value must be set; '

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.
October 22, 2024

Would you please post an image of your complete rule, an image of the action using that smart value, and of the audit log details showing the rule execution?  Thanks!

Suggest an answer

Log in or Sign up to answer