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

How can I get GitHub Enterprise commit info from the oslc_cm:tracksChangeSet link programatically?

Using RTC 6.0.1, I've setup the integration to GitHub Enterprise and see that I can create oslc_cm:tracksChangeSet links on the work item after a push to my GitHub Enterprise.  This all works great.   From RTC Web, I can hover over this link in the work item, and get the UI dialog that shows me information about the commit, the comment, the repo, etc.  This works great.  However, to be useful in an Enterprise setup, I need to create some automation that processes this link.  In my case, a simple custom Advisor is trying to grab this info and use it to control process. 

Here is an example of the oslc_cm:tracksChangeSet link from my setup  (I've x'ed out the hostname).  This work item only has one commit linked to it:

 "oslc_cm:tracksChangeSet": [
    {
      "dcterms:title": "A test comment: workitem 13",
      "rdf:resource": "https://xxxxxxxxxxxxx:9443/ccm/com.ibm.team.git.internal.resources.IGitResourceRestService/commit?value=H4sIAAAAAAAAAI2QzW7CMBCE7zyFlXOD_7HjE30Hjr74Zw0WhETEERJV372xKiP11r3t6NuZ0X7t0DZd6AzqPlGBpaAwjSPci0HP6XHNBUZEeffxy8XKMUJVT0RP1YkejOCG6201hDQKKhU93G7unKfjuuyzH_ebbwOuFVCSS8c0F5RoIVj0SSudooaBMBYYa_D9j1tTl6oOjktIEILS-iC9HARwCNFHx3hIoAdPHYvxbbXWo0sp82Istvicy2X1rZzF7xCLnyn2bp6h5Bc8LK4_ycXifwfuvn8A-067a1oBAAA."
    }
]

If I do a GET of the rdf:resource, I get a 200 back, but no content.   I was hoping to get a nice formatted JSON string of what I see in the hover dialog from the Web.  

If I paste in this link into my browser, I get redirected to the GitHub repo and can see the entire commit nicely, with a diff, etc.  But, I need just a few pieces of this info out of this commit data for my processing.  From the workitem context, I don't know the GitHub Enterprise repo or the commit's SHA1 value.  I suspect this is encoded in the stuff that is after the value= above.

Can I ask the service: com.ibm.team.git.internal.resources.IGitResourceRestService to return some simple commit data for me?  This would make my life so much easier..... 

If that is not possible, how can I get my GitHub Enterprise repo and my commit SHA1 value from the string: "H4sIAAAAAAAAAI2QzW7CMBCE7zyFlXOD_7HjE30Hjr74Zw0WhETEERJV372xKiP11r3t6NuZ0X7t0DZd6AzqPlGBpaAwjSPci0HP6XHNBUZEeffxy8XKMUJVT0RP1YkejOCG6201hDQKKhU93G7unKfjuuyzH_ebbwOuFVCSS8c0F5RoIVj0SSudooaBMBYYa_D9j1tTl6oOjktIEILS-iC9HARwCNFHx3hIoAdPHYvxbbXWo0sp82Istvicy2X1rZzF7xCLnyn2bp6h5Bc8LK4_ycXifwfuvn8A-067a1oBAAA."





0 votes



2 answers

Permanent link

 Hi Dave,

Please raise a RFE for a new service to return the mentioned commit data.

1 vote

Comments


Permanent link

Hi Dave,
    I've created 423784: Add a service/API that provides basic information for Git commits associated with work items to track this.
Cheers
--Rupa
Technical Lead, Rational Team Concert

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
× 10,938
× 20
× 5

Question asked: May 25 '17, 6:47 p.m.

Question was seen: 2,874 times

Last updated: May 31 '17, 2:19 a.m.

Confirmation Cancel Confirm