Forums

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

Element Connect - Root element, filtering

Joel Batac
Contributor
July 7, 2022

HI,

 First time EC user here . How do I filter my json file? I only want to display in my jira if it is in approved status 

 

{
"data": {
"iterateIP": {
"IP": [
{
"name": "ACME Corp",
"shortId": "12345",
"state": {
"id": "approved"
}
},
{
"name": "WACO 123",
"shortId": "abcd3",
"state": {
"id": "cancelled"
}
},

{
"name": "Mickey Mouse Inc",
"shortId": "000314",
"state": {
"id": "open"
}
}
]
}
}
}

I tried this but not working

 

$.data.iterateIP.IP.*[?(@.id=="approved")]

 

@Julie d_Antin _Elements_ 

 

1 answer

0 votes
Sebastian Krzewiński
Community Champion
July 7, 2022

Hi @Joel Batac 

 

Can you share whole configuration of EC field? It will be easier to investigate this.

IMHO you should use $.data.iterateIP.IP[?(@.id=="approved")] but as I said - it will be better when you will share field config (can be a screenshot)

 

Regards,

Seba

Joel Batac
Contributor
July 8, 2022

image.png

Joel Batac
Contributor
July 8, 2022

Hi Sebastian, I got it working..

 

I missed the .state, it should be $.data.iterateIP.IP[?(@state.id=="approved")]

 

Like Sebastian Krzewiński likes this
Joel Batac
Contributor
July 8, 2022

@Sebastian Krzewiński  - is it possible to display name and shortId together?

Sebastian Krzewiński
Community Champion
July 10, 2022

@Joel Batac how do you display data in field? Can you share whole 'edit view' tab?

Joel Batac
Contributor
July 11, 2022

Capture.PNG

Joel Batac
Contributor
July 11, 2022

Sebastian - i think were good, I just mentioned both in the Template

Joel Batac
Contributor
July 11, 2022

@Sebastian Krzewiński -  another problem/question :) now that we'll want move forward with EC. How do we update old tickets (5000+) that don't have shortid (EC Field) and name(different CF) using issueid?

FYI, shortid and name will be different for each issueid.

Sebastian Krzewiński
Community Champion
July 13, 2022

@Joel Batac Can you tell more what do you want to do?

Suggest an answer

Log in or Sign up to answer