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.
Hello @Rudy Holtkamp
If this response is valid JSON which Jira will let us parse,
Then, after your web request call, can you try to do Advanced Branching on smart value {{webResponse.body.props}} and variable =myprops,
You should be able to access {{myprops.startDate}} and do if condition that {{myprops.startDate.jiraDate}} greater than {{now}} then capture your prop in variable?
The problem with using an advanced branching, that it does not wait until it has been executed. So if I try to catch it in a variable in the branch, the rest of the automation rule continues without having the correct value of the variable.
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.