Accessing ticket custom field (checkbox) value

Chaturanga Jayasinghe March 22, 2023

Hi, 

I'm sending a web request from Jira to Azure to trigger a pipeline. In the web request I'm sending the issue key by simply using {{issue.key}}

I also want to send the value of the custom field "environment" which is a checkbox. The field have a value for the ticket I'm trying send. Note that I have two fields in my jira project as Environment. One field is a text field and the other is a checkbox. I want to access the checkbox field value. 


My request body is as follows:

{
"resources": {
"repositories": {
"self": { "refName": "refs/heads/main" }
}
},
"templateParameters": {
"testPlanKey": "{{issue.key}}",
"targetEnvironment": "{{issue.Environment.name}}"
}
}

 

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 22, 2023

Welcome to the Atlassian Community!

I am not sure I have understood the question, but https://library.adaptavist.com/entity/basics-updating-customfields-cloud?tab=cloud shows you how to set a custom field value.  For select lists and checkboxes, the value should be the name of the option you want to set  (If, for example, your checkboxes field for "colour" has options Red, Yellow and Blue, then send "Yellow" to get the tick next to the yellow option)

Chaturanga Jayasinghe March 23, 2023

I'm triggering my Azure Pipeline from the Jira Automation rule. In this rule, I'm sending a Web Request using the Web Request Component in the rules. I'm triggering the automation rule from a Jira ticket. 

So in this web request ( I have posted the request body above) body, I'm sending the Jira Issue Key, which is working fine. The Jira issue/ticket also have a custom field named as "Environment". I want to pass the value of this field also in this request. I tried passing this value like in the web request I posted above. But it is not working.

TAGS
AUG Leaders

Atlassian Community Events