How to access Asset data in a validator, JSM issue create

Tom Lister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 27, 2023

I want to validate a JSM request using scriptrunner in the create step. But I'm struggling to get it to work.

I have the following to check the id of an Asset field is the value e want and to also check a second dependent field is populated.

(issue?.customfield_12411.filter(it => it.objectId == "608").length > 0)
&&
issue?.customfield_10344 != null

This works as expected in the Test option o the validator set up screen.

But in situ, creating a request ticket in the portal it returns the error message in all conditions.

Has anyone accessed Cloud Assets in a jira expression?

1 answer

0 votes
Ken McClean
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.
May 8, 2023

@Tom ListerI know that when we were using ProForma for forms, we had a hell of a time getting the values of custom fields.  Essentially no matter what we did, if the validator was running on issue create it would run BEFORE the custom field had a value filled in.

I think I eventually ended up adding some code to my validator that first reindexed the specific issue, and only then checked it for the value of the custom field.

Tom Lister
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 9, 2023

Hi @Ken McClean 

I have been told by Appfire that this is a known bug and is being tracked here

https://jira.atlassian.com/browse/JSDCLOUD-12479

We may look at automation to check the data and notify the reporter that there are data conditions to check.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events