I'm looking for a recommendation on a way to best set up a "global" variable for a project. Our scenario is as follows
Get a new bearer token (OAuth 2.0), which expires every 24 hours.
We request the new token and store it in a variable
We take the token stored in the variable and use it to make an API call to create the requisition in Coupa
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
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.
You can't pass information used in a rule to another rule unless you store information within the system.
This field does not need to be on the screen and it could be just a text field.
Even based on you first sentence to set a global variable, to me this is you want to re-use a piece of information. This needs to be stored somewhere to get used globally.
Yeah that is what i figured. We do have a security aspect that they indicated we cant store it in the field. Even though it won't be a screen, its searchable in a filter which was their concern since we use tools to move to data to different reporting tool.
Though the risk is very low since we can have that field excluded from going to the other tool, its not 100% safeguard.
Maybe ill make a feature request to Atlassian for a project variable within the automation tool to allow a consent variable to be reused within that project.
Thanks @Marc - Devoteam for the response... love the user icon too!
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.