Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Retrieving the raw file from a changeset using the REST API

 I have built a small python program for playing around with defects. I am able to pull the changeset collection from  a defect and view the JSON file from the changeset:
 "{
  \"modifiedBy\": {
    \"uri\": \"itemOid\\\/com.ibm.team.repository.Contributor\\\/_-jH3wEslEeWIwpv-V-YAdQ\",
    \"itemId\": \"_-jH3wEslEeWIwpv-V-YAdQ\",
    \"com.ibm.team.repository.typeName\": \"com.ibm.team.repository.Contributor\"
  },
  \"changes\": [
    {
      \"item\": {
        \"uri\": \"itemOid\\\/com.ibm.team.filesystem.FileItem\\\/__5o0cB46EeSVP4AOyaueFQ\",
        \"itemId\": \"__5o0cB46EeSVP4AOyaueFQ\",
        \"com.ibm.team.repository.typeName\": \"com.ibm.team.filesystem.FileItem\"
      },
      \"kind\": 2,
      \"internalId\": \"_BoAmYKQNEeW8tvYITYLrgw\",
      \"merges\": [
        {
          \"state\": \"_RSx_xKNVEeW8tvYITYLrgw\",
          \"kind\": 2,
          \"internalId\": \"_Eu--YKQNEeW8tvYITYLrgw\"
        },
        {
          \"state\": \"_uhcTxPTpEeWwxYsnqAeZMw\",
          \"kind\": 2,
          \"internalId\": \"_RHgJoPWjEeWwxYsnqAeZMw\"
        }
      ],
      \"after\": \"_QvOzlPWjEeWwxYsnqAeZMw\",
      \"before\": \"_Fo6TSI4YEeWx7vJbV417Gw\"
    }
  ],
  \"originalSourceType\": 0,
  \"active\": false,
  \"originalSourceId\": null,
  \"modified\": \"2016-03-29T14: 17: 55.200Z\",
  \"predecessor\": \"_RHgJofWjEeWwxYsnqAeZMw\",
  \"contextId\": \"_Dp6kMdwTEd2jUupDpQV1Rw\",
  \"uri\": \"itemOid\\\/com.ibm.team.scm.ChangeSet\\\/_BkszsKQNEeW8tvYITYLrgw\",
  \"stateId\": \"_B7kI-fW5EeWwxYsnqAeZMw\",
  \"itemId\": \"_BkszsKQNEeW8tvYITYLrgw\",
  \"mergePredecessor\": null,
  \"properties\": [
    
  ],
  \"lastUpdatedDate\": \"2016-03-29T14: 17: 55.152Z\",
  \"owner\": {
    \"uri\": \"itemOid\\\/com.ibm.team.repository.Contributor\\\/_-jH3wEslEeWIwpv-V-YAdQ\",
    \"itemId\": \"_-jH3wEslEeWIwpv-V-YAdQ\",
    \"com.ibm.team.repository.typeName\": \"com.ibm.team.repository.Contributor\"
  },
  \"sourceType\": 0,
  \"etag\": \"_B7kI-fW5EeWwxYsnqAeZMw\",
  \"sourceId\": null,
  \"component\": {
    \"uri\": \"itemOid\\\/com.ibm.team.scm.Component\\\/_ouBTQE53EeCaGOtM6Ru5Tg\",
    \"itemId\": \"_ouBTQE53EeCaGOtM6Ru5Tg\",
    \"com.ibm.team.repository.typeName\": \"com.ibm.team.scm.Component\"
  },
  \"xComponentLink\": null,
  \"comment\": \"Merges 10.1 pom changes with current development\",
  \"com.ibm.team.repository.typeName\": \"com.ibm.team.scm.ChangeSet\"
}"

Now, I want to pull a copy of the file from this json file. What is the URL I need to compose to get the file? 

Thanks. 

0 votes

Comments

Try the URI that has "com.ibm.team.filesystem.FileItem" in it.



One answer

Permanent link
There is a similar discussion here - https://jazz.net/forum/questions/38090/get-files-referred-in-a-change-set-via-rest-apis

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 480
× 149

Question asked: May 09 '16, 11:18 a.m.

Question was seen: 1,724 times

Last updated: May 10 '16, 7:55 a.m.

Confirmation Cancel Confirm