Working with Rally project state using the pyral python module
search cancel

Working with Rally project state using the pyral python module

book

Article ID: 248159

calendar_today

Updated On:

Products

Rally SaaS Rally On-Premise

Issue/Introduction

This article outlines a concept for working with Rally project state using the pyral python module.

Please be aware that the topic discussed here is for academic purposes and is not intended to imply a guarantee of support.  Support for the API and third-party applications is provided on a bast-case effort.

Resolution

In order to manage the project's status of open or close, the Project object contains an attribute called State.

The State attribute can be set to Open or Closed.

In order to update the project state in pyral, it is necessary to set up a payload referencing the target project's object ID and including the state attribute as shown below:

project_object_id = <PROJECT_OID>
update_payload = {
 "ObjectID": <PROJECT_OID>,
   "State": "Closed"
}

Next, make the call to the update method on your Rally instance as shown below:

update_project = rally.update("Project", update_payload)

While the API can work with a closed project if you have the object ID, it cannot query the API for closed projects in general.  Therefore, it is important to store the object ID in a separate file or database so that you can have your script make updates to that project's state at a later time.  It would also be advisable to log that project's parent object ID, if applicable, in order to work through the project hierarchy to reopen parents since you can not have an open sub-project under a closed parent project.

So your closed project file may appear as follows:

target_project,parent_project
1111111111,1111111110
1111111110,null