Hi,
I've question about Jira automation, particularly filtering data from a webresponse.
I've the following response in a smart value {{webResponse.body}}:
{
"props": [{
"prop": "AA",
"planAs": "0"
},{
"startDate": "2024-06-10",
"prop": "BB",
"planAs": "0"
}, {
"startDate": "2024-11-01",
"prop": "CC",
"planAs": "0"
},{
"prop": "DD",
"planAs": "0"
},{
"startDate": "2023-09-03",
"prop": "EE",
"planAs": "0"
},{
"startDate": "2024-07-28",
"prop": "FF",
"planAs": "0"
},{
"startDate": "2024-07-28",
"prop": "GG",
"planAs": "0"
},{
"startDate": "2023-09-03",
"prop": "HH",
"planAs": "0"
},{
"startDate": "2023-06-10",
"prop": "II",
"planAs": "0"
},{
"startDate": "2024-06-11",
"prop": "JJ",
"planAs": "0"
},{
"startDate": "2024-06-21",
"prop": "KK",
"planAs": "0"
},{
"startDate": "2024-12-31",
"prop": "LL",
"planAs": "0"
}]
}
I want to filter out all props that either don't have a startDate (in this case AA & DD) or all props that have a startDate before and including today (which is now June 10th 2024, but this is of course variable) which wil result in BB, EE & II
How can I do this, using smart value conditions or a regex?
By creating a variable props with smart value {{webRespons.body.props}} and using a new variable myProps with smart value {{props.match("\{.*?prop=(.*?), planAs=\d\}, ")}}
I get all the props, but I really need only the ones with a startdate of today or before.