A helper class for working with the public REST API for Jama. API documentation here.
Only standard Python 3 modules.
Import classes. Optionally, import your credentials from a separate python module.
from jama_api_helper import JamaInterface, JamaItem
from secrets import jama_client_id, jama_client_secret
Create a JamaInterface object by specifying the API endpoint URL for your specific cloud instance.
jama = JamaInterface(
endpoint_url='https://your_cloud_instance_here.jamacloud.com/rest/latest')
Authenticate using your client ID and client secret, which are generated within the Jama web application under user settings.
jama.authenticate(client_id=jama_client_id,
client_secret=jama_client_secret)
Retrieve an item from Jama by specifying the project ID and item ID.
item = jama.get_item(project_id=128, item_project_id='MY-REQ-101')
Alternatively, retrieve an item from Jama by specifying the global ID for the item.
item = jama.get_item(global_id='GID-101')
Print a string representation of the Jama item.
print(item)
Print all fields of the Jama item.
item.print_fields()
The fields of the Jama item are contained in a Python dictionary. The keys are provided by the Jama system and correspond to the fields of the Jama item type.
name = item.fields['name']
fields = item.fields.keys()