Forums

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

greenhopperAsJSON fails to get first entry in a list of greenhopper values

Demolag
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 Champions.
January 11, 2026

We lately updated the confiform extension on our datacenter to 3.19.11, and some of our IFTTTs stopped working.

In order to get last ID from sprint customfield from a jira epic (for new issue creation), we used the following expression:

[entry.epic.customfield_<n>.greenhopperAsJSON.get().id]

which gave us the last ID to use when creating a new issue under that epic.

Now, after updating the extension, that expression started returning an empty array ([]).

I've tried to play abit with the expression, and found out that the greenhopperAsJSON gives us a broken result. For example, for the following fields:

a = 

["com.atlassian.greenhopper.service.sprint.Sprint@00000001[id=10001,rapidViewId=32500,state=CLOSED,name=Sprint - Sep 25,startDate=2025-09-01T02:52:00.000-05:00,endDate=2025-09-30T02:52:00.000-05:00,completeDate=2025-10-05T03:29:23.901-05:00,activatedDate=2025-09-08T03:27:17.605-05:00,sequence=1,goal=,synced=false,autoStartStop=false,incompleteIssuesDestinationId=]","com.atlassian.greenhopper.service.sprint.Sprint@00000002[id=10002,rapidViewId=32500,state=CLOSED,name=Sprint - Oct 25,startDate=2025-10-05T03:31:00.000-05:00,endDate=2025-10-31T04:31:00.000-05:00,completeDate=2025-11-02T03:29:08.648-06:00,activatedDate=2025-10-05T03:31:38.905-05:00,sequence=2,goal=,synced=false,autoStartStop=false,incompleteIssuesDestinationId=]","com.atlassian.greenhopper.service.sprint.Sprint@00000003[id=10003,rapidViewId=32500,state=CLOSED,name=Sprint - Nov 25,startDate=2025-11-01T10:26:00.000-05:00,endDate=2025-11-30T09:26:00.000-06:00,completeDate=2025-12-01T06:11:48.540-06:00,activatedDate=2025-11-02T03:31:08.053-06:00,sequence=3,goal=MX RTM,synced=false,autoStartStop=false,incompleteIssuesDestinationId=]","com.atlassian.greenhopper.service.sprint.Sprint@00000004[id=10004,rapidViewId=32500,state=CLOSED,name=Sprint - Dec 25,startDate=2025-12-01T06:35:00.000-06:00,endDate=2025-12-31T06:35:00.000-06:00,completeDate=2026-01-04T10:36:11.549-06:00,activatedDate=2025-12-01T06:13:44.309-06:00,sequence=4,goal=,synced=false,autoStartStop=false,incompleteIssuesDestinationId=]","com.atlassian.greenhopper.service.sprint.Sprint@00000005[id=10005,rapidViewId=32500,state=ACTIVE,name=Sprint - Jan 26,startDate=2026-01-01T12:07:00.000-06:00,endDate=2026-01-31T12:07:00.000-06:00,completeDate=,activatedDate=2026-01-04T10:37:54.547-06:00,sequence=5,goal=,synced=false,autoStartStop=false,incompleteIssuesDestinationId=]"]
the following expression a.greenhopperAsJSON.id get us ", 10002, 10003, 10004, 10005"
greenhopperasjson.png
Is this a known issue, or am I using the virtual function wrong?
If I am using it wrong, how can I get the results I need as explained above?

1 answer

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Community Champion
January 11, 2026

Honestly, I am quite amazed that it is like 10+ years later and still this issue is not fixed in the Jira REST APIs, and someone needs to rely on the function we have implemented to deal with this nonsense.

Anyways... What do you want to get out of that data?

Demolag
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 Champions.
January 11, 2026

Originally, we wanted to get the ID field of the last greenhopper object - so in the case of the example, we want to extract the number 10005.

Extracting all of the IDs works as well.

 

Alex Medved _ConfiForms_
Community Champion
January 12, 2026

I have to say that we need to revisit this function - it seems to misbehave when I try to test it. This will be fixed in the upcoming release of CofnfiForms

Like Demolag likes this
Demolag
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 Champions.
January 18, 2026

Returning to the question above. While greenhopperAsJSON virtual fucntion seems to work as expected right now, now I'm facing another issue.

While the following format works on epics with more than one sprints:

epic.fields.customfield_n.toString.greenhopperAsJSON.transform(id).get()

 when I get epics with only 1 sprint on their array, the greenhopperAsJSON virtual function turns them into a single value instead of a List containing a single value, which means transform and get virtual functions don't apply to them.

Any ideas?

Demolag
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 Champions.
January 18, 2026

For now I use the following, but it still seems something is broken.

id.evaluateFormula(IF(EMPTY("[entry.epic.fields.customfield_n.toString.greenhopperAsJSON.transform(id).get()]"), "[entry.epic.fields.customfield_n.greenhopperAsJSON.id]", "[entry.epic.fields.customfield_n.toString.greenhopperAsJSON.transform(id).get()]"))

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events