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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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 create a Portfolio Resource using the Java API?

We try to create a Portfolio Resource (ResourceDTO) using the Portfolio Java API. To create a resource we use a JiraUserDTO of a real Jira user, that is part of the PersonDTO that is part of the ResourceDTO to create.

Now the problem is, that the following code creates the Resource but also a new Person in the database, that is inconsistent. It should reuse the passed in Person and not create a "wrong" new one. After the following code, the PersonAPI cannot find any Persons anymore - Portfolio Plans don't work anymore:

PersonDTO personJean = personApi.findById(214L).value(); //it finds the correct person
ResourceDTO resourceJean = ResourceDTO.builder().withPerson(personJean).withTeamId(1).build();
long
resourceId = resourceApi.create(resourceJean); //creates the resource but a second Person inconsistent in database, but should use existing person personJean

 We use Portfolio 3.11.0.

Thanks a lot for any hints or suggestions! BR, Sebastian

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Advanced Roadmaps

3 short videos to help you get started with Advanced Roadmaps

Hi community, I’m Roi, a product manager working on Advanced Roadmaps for Jira. While Advanced Roadmaps is a powerful tool to plan and track work at scale, we know it can be challenging to get star...

6,458 views 24 18
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