How to update a rich text field with embedded pictures via REST API

Serge Prud'homme
edited July 2021 in

Hi,

I'm working on a tool to import requirements into Jama.

I'm trying to emulate embedding picture in the description field the same way it can be done via Jama's web UI.

Below is the HTML of the rich text I want to set in Jama via the REST API.
Note the 'img' element near the bottom:

The TX shall operate in a single polarization over the following specific bands :<br/> <ul>
<li>[7.8-7.9] GHz<br/></li>
<li>[48.8-50.2] GHz<br/></li>
</ul>
<img src="testpict-1.png" height="169" width="627" /> <br/>
Figure 1 : Downlink User-link frequency <br/>

I want to add the picture as a Jama attachment and then perhaps tweak the 'img" element content to point to it so it gets properly rendered in the Jama web UI. i.e. the picture must render above the "Figure 1: Downlink User-link frequency plan" text.

How do I do this via the REST API?

I did look at "Step 2: Create a Hyperlink to your Attachment Item" on this page:
https://community.jamasoftware.com/blogs/iman-bilal/2017/08/29/attachments-attachments-attachments

Unfortunately this doesn't seem to work. Perhaps I' building the URL incorrectly.
Here is an example of the URL:
<img alt="" height="190" src="https://jama.mycompany.com/attachment/283982/testpict-1.png" width="397" /></p>

Where 283982 is the attachment ID returned by the REST API upon creation and testpict-1.png is the file name that was added to the attachment.



Comments

  • Decoteau Wilkerson
    edited July 2021
    Hi Serge, 

    Thank you for reaching out about this! I see you have a current Support ticket discussing this matter at the moment. Once that ticket has been resolved, I will post a synopsis here for refernce. In the meantime, I will be curious to see whether another Community member has their own suggestions.
    Decoteau Wilkerson
    Content Marketing Specialist
    Jama Software
    Oregon