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

Trying to set an Asset Object Reference that might be empty with A4J

C_ Derek Fields
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.
August 20, 2024

Environment

  • I have an Asset custom field called ObjectA. This field may be empty or may contain an Object
  • I have a second Asset custom field called ObjectB. 
    • ObjectB has an attribute that is a reference to an Object A type of object
  • I have an automation that sets the reference on ObjectB to ObjectA. This uses the smart value {{issue.ObjectB}}

Problem

  • When ObjectA has a value, it works as expected.
  • When ObjectA is empty, the Automation indicates an error 
    • OBJECT-123 (ObjectA = '') 
  • This is because ObjectA is empty and the smart value returns an empty string

The error doesn't actually affect the operation of the automation, but it raises an error, which sends me an email, which is annoying. I can turn off the notifications, but that means that if something else breaks, I don't get notified.

What I want to do is to clear the ObjectA attribute when ObjectA is empty on the issue or set ObjectA when it is set on the ticket.

Any suggestions?

1 answer

0 votes
Lisa Forstberg
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.
August 22, 2024

Hi @C_ Derek Fields ,

I might not be catching on completely.

Can you add a condition to the automation to only fire if the custom field "Object A" is populated.

Perhaps you can add a screenshot of the automation, that tends to speed up the help.

br

Lisa

 

C_ Derek Fields
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.
August 22, 2024

Here is a partial screen shot. I am using the "Create Object" action to create an Assets object.

Snag_23d2017c.png

 

If one of these fields from the issue is empty, A4J throws an error message. The object is created correctly and the rule continues on. However, I get a failure email notification. I tried using an {{if}} conditional, but that raises the same problem.

The root problem appears to be that the smart value returns an empty string instead of a null and that confuses the rest call when it tries to update the value.

Rune Rasmussen _Admin_ November 7, 2024

Did you ever find an answer to this situation?

I'm facing similar issues with empty strings versus null, and it's driving me up the wall.

Lisa Forstberg
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.
November 8, 2024

Possible workarounds?

1) use validations in Jira to ensure the data is completely filled 

2) Have a two step approach in the automations.

Step one:  Create the object with the fields you know will always be populated

Step two: If field  X  is populated, then action "update object"  to complete those attributes of the object.

 

Just an idea, have not tested it myself ;-)

/Lisa

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events