Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Issue smart values not accesible inside listed values loops

I am retrieving some Jira issue from a remote system via REST API and then iterate the comments.

Inside the comments loop, I can read the updated field and I want to compare this field with an issue field value (such as last sync date and time) but apparently, no issue field values can be accessed from within the listed loop.

Nor even a custom-defined smart value can be accessed there. So I am missing a way to compare the comments times and then pick only those more recent than my last sync date and time field.

Even with this fixed, I am still unsure if an IF condition can be applied inside such loop.

Does anyone have an idea how to pick only most recent comments from an issue retrieved by API using smart values?


1 comment

Hi @Richard Vencu 

Did you see this post, which shows at the end an example to get the latest comment using the REST API?

Best regards,


Thanks. I know how to get the REST API response. My problem is that I am inside automation rule and I do not have programmatically access to the JSON response but merely the smart values exposed by the automation

There are smart values that allow reading inside a loop (when a list of objects is retrieved). However it seems that inside that loop the parent context is lost and I cannot use existing parent variables to compare with variables inside the loop.

So I am searching for a master of smart values here :)

Thanks, @Richard Vencu 

Perhaps if you post an image of your current rule that will help people give you ideas.  For example, techniques to work-around some of the context/scope issues for information access within a rule with techniques like created variables, custom fields, or entity properties.

Is the image above. So whiile iterating the comments from the rest api call, I would like to add a test clause with IF smart value and compare the comment timestamp with a variable that is declared before the loop, in this form {{threshodlTimestamp}}

The problem is that before the loop i.e. before {{#webhookResponse.body.fields.comment.comments}} I can display the variable value, it is visible, Inside the loop the variable is not existent.

Of course if I replace {{threshodlTimestamp}} with a hardcoded timestamp value it works. I can even make a relative timestamp to now such as {{now.minusDays(5)}} and get only the last 5 days comments but this would force me to run things on a schedule. It is feasable but also increases the load.

So I am only complaining why a variable or a field value from the context issue is not available inside a loop of data fetched via REST API call. Maybe the developers can enlighten us here...

Yes, that is a known problem (design choice) that operators and functions do not work inside of the iterators. I submitted a defect on Cloud version and support said, "by design".

The only work-arounds I have seen were to use a created variable (for single values) or to pre-compute the value in a custom field (for multiple values).

Like Richard Vencu likes this

Using a custom field would be an acceptable solution for me, if it works. I will give it a try. Thanks.

Like Bill Sheboy likes this


Log in or Sign up to comment
Community showcase
Published in Jira Service Management

Known problems with customer accounts

The purpose of this post is to help people identify and resolve some of the most common problems that affect customer accounts in JSM projects.   1. Customers can't see their own requests in...

371 views 3 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you