Support

Expand all | Collapse all

Issue with posting comments via REST API

  • 1.  Issue with posting comments via REST API

    Posted 24 days ago

    I am migrating banch of requirements from xml and I would like to migrate comments. My code is pretty simple (in Python):

    comment_data = {"inReplyTo":0,"body":{"text":"test comment"},"commentType":"GENERAL","location":{"item":item_id,"project":307}}

    comment_response = requests.post('https://nnn.jamacloud.com/rest/v1/comments', headers=headers_2, data=json.dumps(comment_data))

     But I keep getting Response Code 500 – Internal Server Error. Headers are verified, they work ok with posting new item and adding tag to it. The same for item_id variable – works for tags.
    I have a feeling something is wrong with "inReplyTo" value, however I cannot get to the bottom of it.

    Can you please advise what is wrong? Appreciate your help.



    ------------------------------
    Jakub Malek
    Rockwell Automation
    ------------------------------


  • 2.  RE: Issue with posting comments via REST API

    Posted 23 days ago
    Jakub:

    Are you attempting to make new comments in Jama? If so, we think your first instinct is correct, try taking out the "inReplyTo" piece and see if that works.

    Best,

    ------------------------------
    Chloe Elliott
    Jama Software
    Portland OR
    ------------------------------



  • 3.  RE: Issue with posting comments via REST API

    Posted 20 days ago
    This solved the problem, thank you.

    ------------------------------
    Jakub Malek
    Rockwell Automation
    ------------------------------