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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,237
Community Members
 
Community Events
184
Community Groups

In jira portfolio, how can add a person to a team using rest API

Edited
Javier Perez
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.
Dec 10, 2018

Having: a team with id=13 and an a person with id=104

I've tried:

curl -uuser:password -X POST -H 'Content-Type: application/json' -d '{ "resources": [ { "person": { "id": "104" } } ], "availability": [ ] }' http://jira/rest/teams-api/1.0/team/13

obtaining: no output message whatsoever and the person was not added to the team either

Input validation

Both

  • http://jira/rest/teams-api/1.0/person?ids=104
  • http://jira/rest/teams-api/1.0/team?ids=13

return the expected entities

1 answer

1 vote
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 13, 2018

Hello Javier,

From reviewing your CURL call, the first thing that might be an issue is your entry URL. It should look something similar to:

https://myjirasite.com/jira/rest/teams-api/1.0/team/13

Replacing myjirasite.com with your Jira site running portfolio.

This might be a mistake as you could have parsed out the actual URL. Can you let us know the full URL you’re attempting to access? Please remove the actual domain from the URL with myjirasite.com.

I look forward to your response from you so we can get you into the API.

Regards,
Stephen Sifers

Javier Perez
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.
Dec 13, 2018

Sthephen,

We're not using context (the /jira/ part). That the URL entry is good is verified by the fact that http://jira/rest/teams-api/1.0/team?ids=13 does actually return data

This is what I'm trying to add a person to a team

curl -uuser:password -X POST -H 'Content-Type: application/json' -d '{ "resources": [ { "person": { "id": "104" } } ], "availability": [ ] }' http://jira/rest/teams-api/1.0/team/13

Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 14, 2018

Hello again Javier,

I tested on Jira 7.12.3 with Portfolio and confirmed the following;

  • Able to edit/get/delete user
  • Able to edit/get/delete resources
  • Able to edit/get/delete teams

We did run into an issue when attempting to add a person as a resource and a person to a team. As you confirmed, you do not get a response (which is the default response currently in the API) but a user is not created.

We are looking further into this to see where the issue is and if it is possibly a defect in the product. Please allow us some time to investigate further.

Regards,
Stephen Sifers

Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Dec 14, 2018

Hello again Javier,

There is a method you can use to create a resource within Portfolio. When creating the resource it will be created as a virtual user. You can run this method for example:

curl -u user:pass -X POST -H 'Content-Type: application/json' -d '{ "teamId": 1, "person": { "title": "admin","jiraUser": {"jiraUserId":"admin"} }}' http://jira.server.name/rest/teams-api/latest/resource

We did confirm this will create a resource within your team.

Regards,
Stephen Sifers

Javier Perez
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.
Dec 14, 2018

Thanks Stephen!

Person is an entity in portofio. Then we have jira users, which are not the same

person, should/shouldn't/either pre-exist in porfolio?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events