Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation - Build Authorization Header Value from Previous Web Response

Timothy Hidalgo May 24, 2022

Hello

I have a web response that validates correctly

jira-screeshot-1.png

The payload returned is:

{
  "access_token": "<snip>",
  "refresh_token": "<snip>",
  "scope": "useraccount",
  "token_type": "Bearer",
  "expires_in": 1799
}


I do have "Delay execution of subsequent rule actions until we've received a response for this web request" checked

I have another send web request that needs to use the access_token in its Authorization header value like so:

jira-screenshot-2.png

The full value is Bearer {{webResponse.body.access_token}}

Thus far I have not been able to successfully build this string :( and validating the second request returns authorization failed. I have tested copy/pasting the access_token into the header and it does work 

UPDATE ***

I believe the token is being passed at this point (after testing) however now it seems like the Web request URL isn't accepting the custom field value

https://some/api/endpoint?number={{issue.customfield_123456.value}}

Any help is appreciated 

1 answer

1 accepted

1 vote
Answer accepted
Timothy Hidalgo May 25, 2022

Looks like I've been able to answer this myself

The custom field value is text so it looks like in both cases all I had to do was remove the .value 

{{issue.customfield_123456}} worked.

Lakshmij August 30, 2022

Can I know from where this value is retrieved  : {{issue.customfield_123456}}  ?

Isn't adding Bearer followed by {{webResponse.body.access_token}} working still ?

Because I need same value to insert in my headers section for another webrequest to trigger, please help. Even adding {{webResponse}} in audit log also not helping/displaying any value.

Lakshmij August 30, 2022

It's working, smart values are working.  What I was missing is didn't change any value on the field value of Jira story as we created automation rule for webhook for story point estimate. 

As soon as I change value on the field "story point estimate" from existing value to the other, then my automation rule invoked webhook with authorization.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events