How to set Key-value pairs for Azure Runbook automation
Asked by Justin Buckley:

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](https://community.atlassian.com/t5/image/serverpage/image-id/298838iEE9304865BF49908/image-size/large?v=v2&px=999 "Screenshot 2024-01-04 at 12.02.57?AM.png")


Answers:
author: Marc - Devoteam
body: Hi [@Justin Buckley](/t5/user/viewprofilepage/user-id/5397641)

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.

comments: author: Justin Buckley
body: 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?


author: Marc - Devoteam
body: Hi [@Justin Buckley](/t5/user/viewprofilepage/user-id/5397641)

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.


author: Justin Buckley
body: [@Marc - Devoteam](/t5/user/viewprofilepage/user-id/3796976)

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>


author: ian
body: Hello [@Justin Buckley](/t5/user/viewprofilepage/user-id/5397641) "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.


author: ian
body: [@Justin Buckley](/t5/user/viewprofilepage/user-id/5397641) - 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.


author: ian
body: 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.


author: Scott Holland
body: [@ian](/t5/user/viewprofilepage/user-id/4591137) 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.


author: ian
body: [@Scott Holland](/t5/user/viewprofilepage/user-id/4586993) 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.


Tags: cloud

jira-service-management

jira-service-management-cloud