Recommended way of changing order of tasks in a story using Java apiclient

19 views
Skip to first unread message

Anjum Naseer

unread,
Apr 23, 2012, 4:19:14 AM4/23/12
to version...@googlegroups.com

Hi,

 

I noticed that tasks have an attribute called Order which changes automatically as you drag tasks around within a story in the V1 web client to re-order them.

 

Is there a recommended way of doing this re-ordering via the Java apiclient to ensure we don’t get a clash of numbers in the Order attribute?

 

Thanks,

 

Anjum

 

ibuchanan

unread,
Apr 23, 2012, 9:21:01 AM4/23/12
to version...@googlegroups.com
Anjum,
 
It might help me explain better if understood where your ordering information is coming from.
 
On the other hand, I can probably provide some context that might help. The Order attribute is of type Rank. Rank objects are intended to be opaque value but can be used for relative ranking using the "+" and "-" operators. Let's say that you wanted to rerank StoryA before StoryB, then here is pseudocode for that operation:
rankB = StoryB.Order;
StoryA.Order = rankB.before();
 
Since the Rank objects are intended to be opaque, here are some considerations about rank values:
* Don't count on a rank value to be the same over time. As you have noticed, when you move one item, the system may shift rank values for many other assets. (One important implication is that you can't assess re-ranking in context of historical queries.)
* Don't count on rank values being positive or negative. They can be either.
* Don't count on rank values being monotonic. The system may decide to leave gaps in the rank values to avoid unnecessary recalculation.
* Rank values are global. This makes it possible to rerank within a subproject and have the same reranking applied in the parent. It also contributes to the last point. If you are in a subproject, you would see lots of gaps between rank values.
* The only real guarantee for rank values is they represent the current relative order, so you can compare the values with greater-than and less-than.
 
Hope that helps.
 
Ian Buchanan
Product Manager for Platform and Integrations

Anjum Naseer

unread,
Apr 23, 2012, 9:27:21 AM4/23/12
to version...@googlegroups.com

Ian,

 

The client I have written wants to treat the Order attributes as an opaque type and I was hoping that I would not have to manage the global uniqueness of these values myself. It looks like the api has been written in a manner that suits my needs perfectly.

 

Thanks again,

 

Anjum

--
You received this message because you are subscribed to the Google Groups "VersionOne-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/versionone-dev/-/f7eomTw_zYIJ.
To post to this group, send email to version...@googlegroups.com.
To unsubscribe from this group, send email to versionone-de...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/versionone-dev?hl=en.

Reply all
Reply to author
Forward
0 new messages