Understanding Operation Variables
When you create an Operation with the Connector Wizard, you can use Operation Variables to make the Operation customizable.
For example, assume you have created a Jira Connector with the Connector Wizard, and you want to add an Operation that lets you create a Jira issue from within RunMyJobs. This will require a POST call to the Jira REST API, with a JSON request body describing the issue to be created. Without Operation Variables, the payload you specify in the request body might look something like this:
{
"fields": {
"project":
{
"key": "MyProject"
},
"summary": "Build an XYZ Widget",
"description": "We need to build an XYZ widget to help our XYZ customers.",
"issuetype": {
"name": "Story"
}
}
}
By creating variables for some of these values, you can enable RunMyJobs users to supply the important values when they submit the Operation's generated Process Definition. The following screen shot shows four Operation Variables, corresponding to four values that need to be customizable.
Once you've created these Operation Variables, you can use them in the JSON request body using ${variableName}
syntax, as follows:
{
"fields": {
"project":
{
"key": "${Project}"
},
"summary": "${Title}",
"description": "${Description}",
"issuetype": {
"name": "${IssueType}"
}
}
}
Then, when you submit the Process Definition generated by this documentation, you can specify the values you want to use, and they will be automatically inserted into the request body.
This example uses Operation Variables in the request body, but you can also use them in the Operation's URL string and in its header fields.
For details about specifying Operation Variables, see Operation Variable Reference.