Using API to upload images into Results column in test runs

Franklin Gu
Franklin Gu Member Posts: 4
Is there a way to use the REST API to upload images/attachments into the Results column in test runs? Currently, our engineers can manually upload images when executing test runs, but I haven't seen documentation on this functionality with the API.

------------------------------
Franklin Gu
------------------------------

Comments

  • [Deleted User]
    [Deleted User] Posts: 152
    edited January 2023
    Hi Franklin, 

    Yes, you should be able to use REST to take that action. The Embedding a Link to an Attachment in a Jama Object section under REST Attachments in the API Cookbook should work if you replace the <a> tag with an <img> tag.

    ------------------------------
    Carly Rossi // she/her
    Community Manager // Jama Software
    Portland, OR
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 01-26-2023 14:12
    From: Franklin Gu
    Subject: Using API to upload images into Results column in test runs

    Is there a way to use the REST API to upload images/attachments into the Results column in test runs? Currently, our engineers can manually upload images when executing test runs, but I haven't seen documentation on this functionality with the API.

    ------------------------------
    Franklin Gu
    ------------------------------
  • Franklin Gu
    Franklin Gu Member Posts: 4
    edited January 2023
    Hi Carly.
    I seem to have been able to successfully uploaded an image to Jama, as the URL I create for the hyperlink will return the image I uploaded. However, my Result fields are only populated by the "Clickable Text" text instead of an image or a link. Is there some special handling I need to do to update rich text fields?
    Thanks

    ------------------------------
    Franklin Gu
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 01-27-2023 13:35
    From: Carly Rossi
    Subject: Using API to upload images into Results column in test runs

    Hi Franklin, 

    Yes, you should be able to use REST to take that action. The Embedding a Link to an Attachment in a Jama Object section under REST Attachments in the API Cookbook should work if you replace the <a> tag with an <img> tag.

    ------------------------------
    Carly Rossi // she/her
    Community Manager // Jama Software
    Portland, OR
    ------------------------------

    Original Message:
    Sent: 01-26-2023 14:12
    From: Franklin Gu
    Subject: Using API to upload images into Results column in test runs

    Is there a way to use the REST API to upload images/attachments into the Results column in test runs? Currently, our engineers can manually upload images when executing test runs, but I haven't seen documentation on this functionality with the API.

    ------------------------------
    Franklin Gu
    ------------------------------
  • [Deleted User]
    [Deleted User] Posts: 152
    edited January 2023
    Hi Franklin, 

    The Insert image to rich text fields section of the Jama Connect User Guide may be helpful here. If you still have questions after reviewing it, please let us know by filing a ticket HERE (making sure to include a link to this thread as part of the description). Our Support team would pick things up with you from there!

    ------------------------------
    Carly Rossi // she/her
    Community Manager // Jama Software
    Portland, OR
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 01-30-2023 12:07
    From: Franklin Gu
    Subject: Using API to upload images into Results column in test runs

    Hi Carly.
    I seem to have been able to successfully uploaded an image to Jama, as the URL I create for the hyperlink will return the image I uploaded. However, my Result fields are only populated by the "Clickable Text" text instead of an image or a link. Is there some special handling I need to do to update rich text fields?
    Thanks

    ------------------------------
    Franklin Gu
    ------------------------------

    Original Message:
    Sent: 01-27-2023 13:35
    From: Carly Rossi
    Subject: Using API to upload images into Results column in test runs

    Hi Franklin, 

    Yes, you should be able to use REST to take that action. The Embedding a Link to an Attachment in a Jama Object section under REST Attachments in the API Cookbook should work if you replace the <a> tag with an <img> tag.

    ------------------------------
    Carly Rossi // she/her
    Community Manager // Jama Software
    Portland, OR

    Original Message:
    Sent: 01-26-2023 14:12
    From: Franklin Gu
    Subject: Using API to upload images into Results column in test runs

    Is there a way to use the REST API to upload images/attachments into the Results column in test runs? Currently, our engineers can manually upload images when executing test runs, but I haven't seen documentation on this functionality with the API.

    ------------------------------
    Franklin Gu
    ------------------------------
  • Alessandro Valli
    Alessandro Valli Member, Data Exchange, Jama Connect Interchange™ (JCI) Posts: 785
    edited January 2023
    Maybe it is worthy to remark that test run steps can not be patched.
    In test runs you can patch name and description (use the endpoints in labs and make sure the fields are not read-only - note the "allow API overwrite" seems not to work here), but not the results in test run  steps.
    I haven't tried it with put endpoints, maybe it works
    Best,
    Alessandro

    ------------------------------
    Alessandro
    Systems Engineer
    SICK AG
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 01-30-2023 13:13
    From: Carly Rossi
    Subject: Using API to upload images into Results column in test runs

    Hi Franklin, 

    The Insert image to rich text fields section of the Jama Connect User Guide may be helpful here. If you still have questions after reviewing it, please let us know by filing a ticket HERE (making sure to include a link to this thread as part of the description). Our Support team would pick things up with you from there!

    ------------------------------
    Carly Rossi // she/her
    Community Manager // Jama Software
    Portland, OR
    ------------------------------

    Original Message:
    Sent: 01-30-2023 12:07
    From: Franklin Gu
    Subject: Using API to upload images into Results column in test runs

    Hi Carly.
    I seem to have been able to successfully uploaded an image to Jama, as the URL I create for the hyperlink will return the image I uploaded. However, my Result fields are only populated by the "Clickable Text" text instead of an image or a link. Is there some special handling I need to do to update rich text fields?
    Thanks

    ------------------------------
    Franklin Gu

    Original Message:
    Sent: 01-27-2023 13:35
    From: Carly Rossi
    Subject: Using API to upload images into Results column in test runs

    Hi Franklin, 

    Yes, you should be able to use REST to take that action. The Embedding a Link to an Attachment in a Jama Object section under REST Attachments in the API Cookbook should work if you replace the <a> tag with an <img> tag.

    ------------------------------
    Carly Rossi // she/her
    Community Manager // Jama Software
    Portland, OR

    Original Message:
    Sent: 01-26-2023 14:12
    From: Franklin Gu
    Subject: Using API to upload images into Results column in test runs

    Is there a way to use the REST API to upload images/attachments into the Results column in test runs? Currently, our engineers can manually upload images when executing test runs, but I haven't seen documentation on this functionality with the API.

    ------------------------------
    Franklin Gu
    ------------------------------
    Alessandro
    Systems Engineer
    SICK AG
  • Franklin Gu
    Franklin Gu Member Posts: 4
    edited January 2023

    Hi all.
    After a stroke of genius, I ended up inspecting in Chrome an image uploaded into the Result column. This gave me an HTML block that I passed as the value to "fields/testrunSteps/result". The HTML block should look like this:

    html = <a ref="https://<DOMAIN>.jamacloud.com/attachment/<ATTACHMENT ITEM>/<ATTACHMENT NAME>"><div class="j-scaled-image-wrapper"><img src="https://<DOMAIN>.jamacloud.com/attachment/<ATTACHMENT ITEM>/<ATTACHMENT NAME>"></div></a>

    Apart from that, like Carly suggested, just follow the REST Attachments portion of the cookbook.

    ------------------------------
    Franklin Gu
    ------------------------------
    -------------------------------------------
    Original Message:
    Sent: 01-31-2023 00:23
    From: Alessandro Valli
    Subject: Using API to upload images into Results column in test runs

    Maybe it is worthy to remark that test run steps can not be patched.
    In test runs you can patch name and description (use the endpoints in labs and make sure the fields are not read-only - note the "allow API overwrite" seems not to work here), but not the results in test run  steps.
    I haven't tried it with put endpoints, maybe it works
    Best,
    Alessandro

    ------------------------------
    Alessandro
    Systems Engineer
    SICK AG
    ------------------------------

    Original Message:
    Sent: 01-30-2023 13:13
    From: Carly Rossi
    Subject: Using API to upload images into Results column in test runs

    Hi Franklin, 

    The Insert image to rich text fields section of the Jama Connect User Guide may be helpful here. If you still have questions after reviewing it, please let us know by filing a ticket HERE (making sure to include a link to this thread as part of the description). Our Support team would pick things up with you from there!

    ------------------------------
    Carly Rossi // she/her
    Community Manager // Jama Software
    Portland, OR

    Original Message:
    Sent: 01-30-2023 12:07
    From: Franklin Gu
    Subject: Using API to upload images into Results column in test runs

    Hi Carly.
    I seem to have been able to successfully uploaded an image to Jama, as the URL I create for the hyperlink will return the image I uploaded. However, my Result fields are only populated by the "Clickable Text" text instead of an image or a link. Is there some special handling I need to do to update rich text fields?
    Thanks

    ------------------------------
    Franklin Gu

    Original Message:
    Sent: 01-27-2023 13:35
    From: Carly Rossi
    Subject: Using API to upload images into Results column in test runs

    Hi Franklin, 

    Yes, you should be able to use REST to take that action. The Embedding a Link to an Attachment in a Jama Object section under REST Attachments in the API Cookbook should work if you replace the <a> tag with an <img> tag.

    ------------------------------
    Carly Rossi // she/her
    Community Manager // Jama Software
    Portland, OR

    Original Message:
    Sent: 01-26-2023 14:12
    From: Franklin Gu
    Subject: Using API to upload images into Results column in test runs

    Is there a way to use the REST API to upload images/attachments into the Results column in test runs? Currently, our engineers can manually upload images when executing test runs, but I haven't seen documentation on this functionality with the API.

    ------------------------------
    Franklin Gu
    ------------------------------