I've got a ConfiForms form with a Jira issue field. The field is of the type Jira issue. By default comments for the issue are not available using the dot notation. I figured out that I can add comments into the object by adding in "comment" into the "Limit to these fields when fetching issues" box.
As an example, I can now access the comments like such ...
issueKey.fields.comment.comments[0].body
My question is this. How do I get the most recent comment? Using comments[0] will get me the first comment, but really I want the last comment. Anybody know how to do that? Is there a virtual function that I can use for this?
Ok, I think I found out how to do it. After MUCH trial and error I had to do this ...
issueKey.fields.comment.comments.asJSON.get().body
Sorry for causing you troubles with the lack of documentation on this scenario.
I am surprised about the solution :-)
I think we need to add something like index=-1 and make something like this to work
issueKey.fields.comment.comments[-1].body
or support empty index
issueKey.fields.comment.comments[].body
What do you think, @Davin Studer ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Alex Medved _ConfiForms_ Yeah, I think one of those would work. Maybe the first would be the best such that you could even do -2, -3, etc to get the second to last, third to last, and so forth.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.