I'm looking for a recommendation on a way to best set up a "global" variable for a project. Our scenario is as follows
- Service Request project where Customers submit requests for a new integration
- The ticket is created, and evaluated by the internal team and if doable they then assign it to another team to generate the quote and cost information
- The quote is attached to the Jira ticket and the quote and cost information are captured in the ticket
- The quote is then provided back to the customer to approve or reject
- If approved, we then take the quote (attachment) and cost information and create a Coupa requisition via a Web request in automation
- Once the requisition is approved and PO cut, work can start
First Coupa Automation Rule (First Web request)
Get a new bearer token (OAuth 2.0), which expires every 24 hours.
We request the new token and store it in a variable
First Coupa Automation Rule (Second Web request)
We take the token stored in the variable and use it to make an API call to create the requisition in Coupa
Second Coupa Automation
Once the request is created, we then run another Web Reuqest to check the status of the requisition. We do this as we need the PO# captured (AKA requisition has been approved) before the integration work can begin.
We need to generate a new bearer token as I can't take the token from the previous rule and use it in this second rule
What I'm trying to resolve
In both automation rules, we are currently requesting to get a new bearer token. ideally, I would like to use the same token until it expires. In the scheduled rule i would have an if-else to check the web request status and if it comes back unauthorized, i then generate a new token.
Since this is a bearer token, i didn't want to store it in a field within the system, but any recommendation or thoughts on how i could pass this token from the first automation rule to the second would be greatly appreciated.
If there is a way to encode it and then decode it, I would be more open to storing it in a field.