How to move items with REST

By Harald posted 01-28-2016 11:47

  
This can be achieved by doing an update to an item, the special thing is that the name must be set at doing that. So using that call, setting the desired location and setting the name to the name field to the value it already has, does the job.

Below is screenshot with sample data:


#requirementsmanagement #REST
10 comments
189 views

Comments

08-29-2016 17:45

Raghu, I just checked in with Steve and there is not a timeframe available. It's still being worked on.

08-20-2016 16:10

HI Steve,

This is a very useful feature and wondering if it has been  already released?. If not can you please give a time frame when it will be available. 

Raghu

06-30-2016 14:09

We have the same needs as Ed noted above.  Order of content needs to be set precisely so that the content of the Word exports flow logically. 

With the SOAP API, we could take advantage of the fact that if we updated the location of a child item "in place" (e.g. parent of item is the same before the call and after) then the item would end up last in the sort order compared to its peers.  Do that multiple times with different children, and eventually we get the sort order we need.  Probably horribly harsh on the system, but sometimes business needs outweigh system needs.

With the current REST API (in release 2016.1), the position of the item no longer changes if we try to update the location "in place", so if we decided to use REST we would have to move the item to another container first, then move it back to get it show up last in the sort order.  I would guess this would put even more load on the system than the SOAP approach, so we're holding off on implementing this.

As you can see, having a way to simply manage the position of a single item amongst its peers would significantly reduce the system load compared to our current approach of repeatedly moving items to 'force' the order we want... and the improvement could be realized without any change to the underlying node management architecture!

As always, thank you for your efforts and improvements!

Mike

06-09-2016 14:55

Ed -

We have the move ready to go, but we need to complete rolling out new code around more efficiently managing the project tree. The reason for this dependency is that inserting a node amongst it peers versus setting the parent can cause heavy load on the system when done in an automated fashion within a large project.

If things go to plan I expect this to be available in the July/August release time frame.

Steve

06-09-2016 14:29

Hi Steve,

when you say you are looking to include the ability to set the exact location in an upcoming release, can you disclose when this will be available? We would really like it.

This is important as we often rearrange the items so that an exported document flows in a logical manner. It's a pain to click and drag and error-prone, as many other users have noted in other community posts.

Please put us on the list for this feature request. Thanks.

Hi Kristina,

If this isn't already in the feature request queue, can you spawn a new request addressing this function? Otherwise, please let me know and I can add one if needed.

Thanks,

Ed

02-01-2016 16:04

Design-wise we've gone back and forth on how best to handle partial updates and the direction we plan on going is to use PATCH.

There is a lot of discussion out there this post and specifically Pedro's response sum things up pretty well http://stackoverflow.com/questions/19732423/why-isnt-http-put-allowed-to-do-partial-updates-in-a-res...

02-01-2016 13:50

Agreed -- it doesn't sound optimal to need to restate all of the unchanged information in the REST request. It seems like this introduces processing and network overhead for no obvious value.

02-01-2016 05:58

That's unfortunately true, but easy to fix.

But this is a weird design, if a field in the item definition is added, all REST API based stuff must be updated.

I would prefer a behaviour that changes only information that is explicitly stated, it should operate like an Update statement in SQL.

01-29-2016 20:39

I would like add 2 things:

1. Currently the only option is to set the parent of an item which will put it at the bottom of the stated container. We are looking to include the ability to set the exact location in an upcoming release.

2. Making an update to an item and not including fields in the update will result in those fields losing values. See https://community.jamasoftware.com/jama/topics/edit-an-item-using-the-jama-rest-api for details.

01-28-2016 21:08

Thank you for sharing this, Harald!