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

How to set Key-value pairs for Azure Runbook automation

Justin Buckley January 3, 2024

Hello! I am looking for help on how to setup key-value pairs on a Jira form that will trigger an automation to start runbook in Azure. (https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Start-runbook-in-Azure)

In this case, I want to pass the values from my form fields to Azure:
FIRSTNAME and LASTNAME are the keys that Azure is expecting... what do I need to enter in the value fields to grab the corresponding data from the form fields? 

Screenshot 2024-01-04 at 12.02.57 AM.png

1 answer

0 votes
Marc Koppelaar - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 4, 2024

Hi @Justin Buckley 

The action to start runbook in Azure, is not able to use smart values (values from other fields to be used in other automation actions or conditions)

So in this case I don't see that the request you have is possible, as you only can specify a key pair in the action directly.

Justin Buckley January 4, 2024

Sorry, not sure I follow. Are you saying I can't pass the values of my form fields to Azure? Seem like that defeats the entire purpose of providing key-value pairs? 

Marc Koppelaar - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 4, 2024

Hi @Justin Buckley 

In the action "start runbook in Azure" you can set defined values, but these values can't be provided by input in fields in an issue.

This can only be done by using automation smart values, but the action "start runbook in Azure", can't use smart values as stated in the documentation.

The values you can use in the action are values in Azure, as the action already requires you to connect Jira with Microsoft Azure.

So the details you can provide in the action, are values, that exist in Azure, but can't be taken from fields in Jira.

Justin Buckley January 4, 2024

@Marc Koppelaar - Devoteam

Thanks for clarifying. This is pretty disappointing and seems like a functional oversight to not be able to simply pass form field values to a runbook. In my case, I was hoping to create a new user account request form (amongst others) but I guess if the values don't already exist in Azure then this automation is pretty limited in scope.

I did find a way to pass some data to Azure, but it's a pain in the butt. For those interested.

https://community.atlassian.com/t5/Jira-Service-Management-articles/Reading-a-Forms-ProForma-field-value-without-the-JSON-tab/ba-p/2097012

ian June 19, 2024

Hello @Justin Buckley "functional oversight" is an understatement!

I've just discovered that I can't use variable/smart values. I don't understand the "values, that exist in Azure" comment from Marc. Why does the value need to exist in Azure (rhetorical). My runbooks have mandatory typed parameters which match the key/value pairs in the Jira automation. I can enter any value of the correct type into these parameters when I manually run the runbook so why can't I send a variable/smart-value through the automation rule.

If I send the wrong value/type, then that's on me. It's a one-way integration afaik so not sure why Jira would care what value I send through the automation. The cynic in me thinks that Atlassian are angling to make this an Enterprise feature.

Sorry for the rant. Will take a look at your link and see if I can use that. Thanks for posting.

ian June 19, 2024

@Justin Buckley - did you investigate using a runbook webhook with the Jira 'send web request' action? This looks like it might work but have only skimmed the details so far.

ian June 19, 2024

Fwiw, in case someone else stumbles across this, a Jira 'Send web request' action to an Azure runbook webhook is working for me. In my basic test, I'm specifying custom data in the Jira request body:

[ {"upn" : "{{reporter.emailAddress}}", "task" : "remove"} ]

My PowerShell 7.2 runbook takes this and adds/removes the reporter from an Azure Ad group using the Microsoft Graph.

It should be easy to extend this to more complex processes. 

Scott Holland June 28, 2024

@ian do you think you would be able to pass a ticket number to the webhook? I just discovered this as an option for automation and am looking to run some commands on tickets as they come in but, not sure how to pass the issue key to the webhook.

ian June 28, 2024

@Scott Holland You can find Jira Cloud automation smart values here: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/

I think you want {{issue.key}}.

You should be able to pass any of these smart values to the runbook webhook in JSON format. You can technically pass all the ticket values as JSON but I've found it easier in the runbook to deal with just the values I need. 

Your comment "run some commands on tickets" has me wondering if you realise this is one direction: Jira to Azure. If you want the runbook to do something with Jira tickets then it would need to connect back to a Jira webhook or similar. I've not done anything in that direction because we've been able to use Jira automation to do all that we need inside our Jira environment.

We have a PowerApp that updates items in Jira Assets with properties from Azure AD but this basically uses the Assets import function. These items are surfaced in our tickets. Some of the third-party apps do this much better now so we may switch to one of them soon.

I hope that answers your qu.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events