creating work item encounter html tags converter issue
Grace Wang (25●1●5)
| asked Jun 24 '16, 3:44 a.m.
edited Jun 24 '16, 4:53 a.m. by Ralph Schoon (63.5k●3●36●46)
Hello,
I using following shell script to create a work item: Shell script: CURL=$HOST"/oslc/contexts/_nO3roXC_EeS6vP4NWXuc2g/workitems" curl -D - -k -b $COOKIES -o "$tmpcreatelog" -H "Content-Type: application/x-oslc-cm-change-request+json" -H "Accept: text/json" -X POST --data-binary @createpdtmp.json $CURL createpdtmp.json file: "dc:title": "Pricing Service Call Failure:<NS1:PricingResponse (.*)<errFlag>true</errFlag> created by RTC API auto", And while the title value in the "createpdtmp.json" file contains character '<' and '>', the characters between '<' and '>' will be missed in the created work item's title, it will become to "Pricing Service Call Failure:<NS1:PricingResponse (.*)true" in the work item' title. I found that if I change the '<' and '>' to html tags: '<' and '>'as following, it will work. Need I to convert all the special characters to html tags? Is there any other methods to resolve this issue instead of converting to html tags? Kindly please help to check and give some advice. Thanks! Replace '<' and '>' with html tags '<' and '>': "dc:title": "Pricing Service Call Failure:<NS1:PricingResponse (.*)<errFlag>true<\/errFlag> created by RTC API auto", |
One answer
The forum may have messed up your original text so it's hard to say what is what in your post. But I will suggest the following.
1. Use the HTTP request header "Content-Type: application/json". I'm not quite sure why you used the one that you have chosen. 2. Escape the double quotes and slashes in your string. In other words, you would use \" and \/. Comments
Grace Wang
commented Jun 27 '16, 2:25 a.m.
Hello,
|
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.