Hello All, Everyone, and/or etc,
I am once again up to my neck in it ("it" being integration hell) and managing to squash all bugs in sight.....except for what I thought should be the easiest part. Pure unadulterated hubris, I know.
This is among the very last steps of an automation I've been struggling to get perfected for weeks, so any help on crossing this last hurdle would be hugely appreciated.
Complete a CQL Search using Jira Automation's "Send Web Request" action.
I've managed to somehow get the authentication working (no thanks to documentation that says 5 different things about how to pass basic authentication to Confleunce, none of which actually work the same way via the webhook), but now I just cannot get the payload correct.
All I need is {{customfield.value}} to get passed on to the end of the request's URL.
No amount of begging/pleading/{{.urlEncode}}-ing has gotten me anywhere.
Does anyone have any hints on how I can just get this friggin CQL search done?
Thank you!
Hey @Evan Nixon
What error/exception are you getting when doing the CQL search?
Using the Log Action You can try logging the result of `.urlEncode` if you are not sure what value it is encoding to https://support.atlassian.com/cloud-automation/docs/debug-an-automation-rule/#2.-Debugging-smart-values
Cheers,
Agraj
Hi @Evan Nixon
To search in title only you should use:
BASE_URL/wiki/rest/api/search?cql=(type=page%20AND%20title~test)
This request will search for pages only, with a title like "test". If you want to search for the exact page title use "=", if you want to search for a page containing a word use "~".
The API doc is here:
https://developer.atlassian.com/cloud/confluence/rest/api-group-search/
The doc about advanced searching using CQP with the API is here:
https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/
I hope this helps.
Cheers,
Dam.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Dam, thanks very much for getting back to me on this!
While that is a really good tip on how to make my query more specific (that I am going to use) I think I may not have been clear enough on exactly what I need help with on this.
So, to be more explicit on my problem :
Here is the smart value I'm trying to use :
{{customfield_10675.leafValue}}
And here is a computer once again leaving a hot steaming pile on my chest because it's jealous of my meat prison :
405 : Both the number of times I've hated this and the relevant error code. Neat!
@Agraj Mangal thank your as well for your reply! I generally find the "Validate Your Web Request Configuration" option easier / better / big gooder-er in these circumstances just by virtue of :
A) Less click more do.
B) It parses smart values, and provides a full read-out of the Request/Response Headers and Payloads (which makes the Audit Log super jealous).
Here is an example which illustrates my objectively true and based point :
The point that I find raises my blood pressure more than a deep fried double down ice cream sandwich the most interesting is the "expecting a value for operator '=' after field 'title'". This tells me two things :
I have tested this with other Smart Values and get pretty much the same result constantly, which is frustrating. But even more frustrating will be when someone replies to this thread with the correct answer and it's both incredibly obvious and has been right infront of my big ol' smell horn this whole time.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok couple of things
I was able to use the following successfully to call the CQL endpoint
Edit 1 -- Just tested it works for Custom Fields also. The catch is you would need to enclose the smart values in single quotes in your CQL query if the smart value is resolving to multiple words. An an example try using
https://****.atlassian.net/wiki/rest/api/content/search?cql=title='{{issue.customfield_10020.name.urlEncode}}'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alright - I've managed to get it to work.
I'll save the super-long explanation, but the behaviour I was running in to was because many page titles contained dashes "-", which wasn't being handled by the ".urlencode" tag. The only way around this was and required a workaround by wrapping double quotes around the smart value, but pre URL encoded as in "%22".
This is what the final query looks like using the ".leafValue" of a cascading select list from a custom field (via Prime Custom Fields).
This allows me to extract the URL from the response and place a Smart-Embed of the relevant confluence page into a custom field using this string :
[https://*****.atlassian.net/wiki{{webResponse.body.results._links.webui}}|https://*****.atlassian.net/wiki{{webResponse.body.results._links.webui}}|smart-embed]
Like this :
Thanks very much for your help!
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.