I need a second pair of eyes for this.
I'm creating a Jira automation that creates Confluence child pages. To get the ID of the parent page, I'm executing a web request that calls a CQL query
The URL is: https://<site>/wiki/rest/api/content/search?cql=title="{{issue.summary.urlEncode.replaceAll("\+","%20")}}"%20AND%20space.key=<key>
When testing the web request configuration, I'm getting "invalid web request URL". The URL string looks like: https://<site>/wiki/rest/api/content/search?cql=title="Feb%2017%20test%202"%20AND%20space.key=TEST
This string looks valid to me. So, what am I missing?
Thanks in advance!
OK, many thanks to Atlassian support to steer me right.
Looks like there should be quotes (") around the term of the first clause of the CQL query, but you can't use the quote characters themselves, so URL encoded ("%22").
The URL looks like this now: https://<site>/wiki/rest/api/content/search?cql=title%20=%20%22{{issue.summary.urlEncode.replace("+","%20")}}%22%20AND%20space%20=%20<key>
Thanks for all your help!
Hi @Robert Wen_Cprime_ , when I try to open URL against my testing environment, it works fine.
Do you "log" url somewhere? Are you sure that "https://<site>/wiki/rest/api/content/search?cql=title="Feb%2017%20test%202"%20AND%20space.key=TEST" is really used?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I haven't enabled this rule yet. I'm testing the web request configuration and that's the string that's returned as part of the error message.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would suggest you to use "Log" action and log the
and try to check logged value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Do you have what I would use to capture the URL used on the request to log? I see the smart values to include for responses, but none for the actual request itself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm guessing save as a variable and use the variable on the web request itself?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you just need to specify the space key like:
https://<site>/wiki/rest/api/content/search?cql=title="Feb%2017%20test%202"%20AND%20space=TEST
The .key is not required
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Strange, this works on my side.
Using such an API call in the browser on my instance.
I can use the same in a web request action in an automation rule and use {{webResponse.body}} to log the result in a log action
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.
Not that I see in the v2 documentation. https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-content/#api-group-content
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.