cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Convert HTML to wiki/markup in codebeamer

Nico_M
10-Marble

Convert HTML to wiki/markup in codebeamer

We need an option to convert html snippets to wikitext.

Use Case: We have a frontend running an html editor. After the user has completed the formatted text in the editor, we need to convert the content to wiki/markup to post it as an item via the API to codeBeamer.

 

In past versions, we have used POST to <baseURL>/cb/wysiwyg/convertHTMLToWiki.spr as a Workaround to get our payload in a wiki/markup format. This worked up to including version 21.09 (EMMA). Since Husky (current SP we are running is 2.0.0.5), this Request returns 403 forbidden instead. Is there another way we could do this conversion, either via API Request (there is wiki2html, so why not the other way around?) or via a helping computation in the tracker config?

ACCEPTED SOLUTION

Accepted Solutions
alfonso_c
14-Alexandrite
(To:Nico_M)

Hi @Nico_M , Product Team may be aware of this requirement, please feel free to raise a topic at at https://community.ptc.com/t5/Codebeamer-Ideas/idb-p/codebeamerideas to inquire about any future implementation plans.

 

As for the topic, this is what I can add here:

  • Relying on non-REST URLs like convertHTMLToWiki.spr may lead to the issue you experienced, i.e. the URL is not tested for its REST API endpoint capabilities, hence other internal changes due to new features or bug fixes modify it unexpectedly.

 

  • You could use the HTML Plugin with a payload similar to the following:
POST /v3/trackers/{trackerId}/items

{
  "description": "[{Html\n\n<b>bold</b> normal <em>italic</em>\n}]",
  "descriptionFormat": "Wiki",
  "name": "test"
}

 A full example is provided at Populating a wikitext field with HTML markup through REST API on Codebeamer 

 

View solution in original post

3 REPLIES 3
alfonso_c
14-Alexandrite
(To:Nico_M)

Hi @Nico_M , Product Team may be aware of this requirement, please feel free to raise a topic at at https://community.ptc.com/t5/Codebeamer-Ideas/idb-p/codebeamerideas to inquire about any future implementation plans.

 

As for the topic, this is what I can add here:

  • Relying on non-REST URLs like convertHTMLToWiki.spr may lead to the issue you experienced, i.e. the URL is not tested for its REST API endpoint capabilities, hence other internal changes due to new features or bug fixes modify it unexpectedly.

 

  • You could use the HTML Plugin with a payload similar to the following:
POST /v3/trackers/{trackerId}/items

{
  "description": "[{Html\n\n<b>bold</b> normal <em>italic</em>\n}]",
  "descriptionFormat": "Wiki",
  "name": "test"
}

 A full example is provided at Populating a wikitext field with HTML markup through REST API on Codebeamer 

 

Dear alfonso,

 

Thanks for your quick reply.

Unfortunately the html plugin will not help us as we need an actual conversion to take place so that the description can be editable in the codeBeamerUI later, which formatting with the plugin does not allow.

 

So it seems like the conversion via either custom built tool by us or you will have to be the solution. I will submit the feature request as you suggested.

 

Cheers,

 

Nico

alfonso_c
14-Alexandrite
(To:Nico_M)

Hello Nico, thanks for the follow-up and updates. Looking forward to helping you again in the forums!

Announcements



Top Tags