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

Set Component field through REST API

Harigovindan GS July 17, 2013

We are migrating bugs from Bugzilla to Jira,for that

We are trying to set Component while creatinng a bug in Jira through REST API

Below is my Json request in groovy(Plugins is the component name i want to set which already exist i tried to give its id also by getting meta data):

json.fields() {

project {

key issueAttr.projectKey

}

summary issueAttr.summary

description issueAttr.description

issuetype {

name issueAttr.issueType

}

customfield_10102 issueAttr.bugzillaUrl

assignee {

name issueAttr.assignee

}

priority {

name issueAttr.priority

}

components: [{

name "Plugins"

}]

}

when i print json object it did not contain component field

{

"fields": {

"project": {

"key": "WAT"

},

"summary": "Bug 18728: Identify new API calls (XML-RPC) in Nessus v5.0",

"description": "Identify new API calls (XML-RPC) in Nessus v5.0",

"issuetype": {

"name": "Bug"

},

"customfield_10102": "http://bugs.redseal.net/show_bug.cgi?id=18728",

"assignee": {

"name": "shreyaskn"

},

"priority": {

"name": "Trivial"

}

}

}

Plz help me

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

6 votes
Raju KC
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.
July 18, 2013

This syntax works for me,

"components": [{"name":"Component1"}]

Juan Pablo Atiaga September 30, 2014

I wish they would have included this in the API documentation!

Like # people like this
1 vote
RambanamP
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.
July 17, 2013
TAGS
AUG Leaders

Atlassian Community Events