Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to set components in Jira REST API 5.x while creating a issue?

HI,

I am creating issues using Jira REST API 5.x. Both issue type and components are avaialbe on the same project. The REST API call creates the issue with no component. I tried following syntax, none of them working,

"components": [{"add":{"name":"TestComponent2"}}]
"components": [{"set":{"name":"TestComponent2"}}]
"components": [{"add":[{"name":"TestComponent2"}]}]
"components": [{"set":[{"name":"TestComponent2"}]}]

Please guide me to resolve it.

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
Answer accepted

It does not need "add" or "set" to include a component in an issue as per documentation,

This syntax works for me,

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

I was also having the same problem but it worked for me. Thanks !!

This works perfectly fine for me. "components": [{"name":"TestComponent1"}]

Like Mark Goodrich likes this

how can you add multiple components? I tried followings:

"components": [{"id":"XXXX"},{"id":"YYYY}]

"components": [{"id":"XXXX", "id":"YYYY}]

I would guess you need

"components": [{"name":"XXXX"},{"name":"YYYY}]
Like Mark Goodrich likes this

how can you add multiple components? I tried followings:

 

"components": [{"id":"XXXX"},{"id":"YYYY}]

"components": [{"id":"XXXX", "id":"YYYY}]

Jira 7.11 :

 

{
"update" : {
"components" : [{"set" : [{"name" : "Automation"}]}]
}
}

 

Yes the json format is hard to follow with so many brackets

TAGS
Community showcase
Published in DevOps

CI/CD in Open DevOps

Two weeks left in our Open DevOps partner spotlight - and we’re excited to be shining a light on CI/CD. A foundational piece of DevOps, CI/CD needs no introduction… but we’ll give one anyways! Cont...

258 views 1 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you