Forums

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

Insight / Asset - Has anyone validated, in Asset interface, attributes of an object ?

G_ Langevin March 29, 2023

I am running an automation to validate field attributes values. Having logic with multiple attributes. I am doing this in a ScriptRunner function. 

Is there a way to display an error message to user and prevent data to be saved until data is corrected?

I tried throwing an exception, but was not able to create properly the exception. Is there a simple way to do this?

 

1 answer

0 votes
Melo
Community Champion
March 29, 2023

Hi @G_ Langevin, if you are validating it during a workflow transition you can use the out of the box "Asset Validator".

I hope that helps.

Cheers,

Melo 

G_ Langevin March 29, 2023

If you are talking about the validator with a regular expression? This can only validate the format of a field. But you cannot do logic with multiple fields.

Melo
Community Champion
March 29, 2023

Hi @G_ Langevin, I was talking about the regular Asset validator, on my end I can use AQL to verify multiples attributes. Are you also validating multiple Asset fields?

Screen Shot 2023-03-29 at 12.54.38 PM.png

G_ Langevin March 29, 2023

Based of field_1 value, the Field2 must have a value and not be null. If another value, field3 must have a value.

This may work. Did you do something like this?

Melo
Community Champion
March 30, 2023

Hi @G_ Langevin

I did not. I would usually use it to do a simple check for assets on a custom field during a workflow transition. Now having more information regarding your requirement I'm not sure if the "Asset Validator" would be enough or the best way of going about it. I hope you find a solution.

Please let me know if you have any other questions regarding basic Asset functionality.

Cheers,

Melo

G_ Langevin March 30, 2023

Thanks for the answer, will get back when I find the solution

Like Melo likes this

Suggest an answer

Log in or Sign up to answer