Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Create Item

Code Block
languagebash
curl -X POST --user $USER_PASSWORD "$JIRA_INSTANCE/rest/tdo/1.0/$PROJECT_KEY/environments/demo-env/types/PersonType/items" \
  --header 'Content-Type:application/json' \
  --data '{
            "data":{
              "Family-Name": "Doe",
              "Year-Born":    "2001"
            }
          }'

Update Item

Code Block
languagebash
curl -X PUT --user $USER_PASSWORD "$JIRA_INSTANCE/rest/tdo/1.0/$PROJECT_KEY/environments/demo-env/types/PersonType/items/$ITEM_KEY" \
  --header 'Content-Type:application/json' \
  --data '{
            "data":{
              "Family-Name": "Doe",
              "Year-Born":    "2002"
            }
          }'

Get Item

Code Block
languagebash
curl -X GET--user $USER_PASSWORD "$JIRA_INSTANCE/rest/tdo/1.0/$PROJECT_KEY/environments/demo-env/types/PersonType/items/$ITEM_KEY"

Get All Items

Code Block
languagebash
# By default locked items are not shown. Toggle the includeLocked to see locked items as well
curl -X GET --user $USER_PASSWORD "$JIRA_INSTANCE/rest/tdo/1.0/$PROJECT_KEY/environments/demo-env/types/PersonType/items?includeLocked=true"

Filter for Items

Code Block
languagebash
# The JSON is the HTML encoded into the &filter= parameter
# Example: Filter for Family-Name=Doe
#   1. JSON: {"Family-Name":"Doe"}
#   2. URL-Encoded: %7B%22Family-Name%22%3A%22Doe%22%7D%0A
curl -X GET --user $USER_PASSWORD "$JIRA_INSTANCE/rest/tdo/1.0/$PROJECT_KEY/environments/demo-env/types/PersonType/items?filter=%7B%22Family-Name%22%3A%22Doe%22%7D%0A"

Search Items

Code Block
languagebash
# Search for items
# Intended for UI/Humans. Fuzzy search through all attributes.
# Note that this search basic at the moment. It is case-sensitive, does not handle umlauts etc etc.
curl -X GET --user $USER_PASSWORD "$JIRA_INSTANCE/rest/tdo/1.0/$PROJECT_KEY/environments/demo-env/types/PersonType/items?searchText=Zurich"

Delete Item

Code Block
languagebash
curl -X DELETE --user $USER_PASSWORD "$JIRA_INSTANCE/rest/tdo/1.0/$PROJECT_KEY/environments/demo-env/types/PersonType/items/$ITEM_KEY"

Lock Item

Code Block
languagebash
curl -X PUT --user $USER_PASSWORD "$JIRA_INSTANCE/rest/tdo/1.0/$PROJECT_KEY/environments/demo-env/types/PersonType/items/$ITEM_KEY/lock" \
  --header 'Content-Type:application/json'

Unlock Item

Code Block
languagebash
# Mark an item as not consumed
curl -X PUT --user $USER_PASSWORD "$JIRA_INSTANCE/rest/tdo/1.0/$PROJECT_KEY/environments/demo-env/types/PersonType/items/$ITEM_KEY/unlock" \
  --header 'Content-Type:application/json'