How do I stop URL encoding in JIRA comments/descriptions

Neil Silverman June 18, 2013

There are several JIRA tickets that we have where a person is being instructed to update database fields, where the value of the field is a URL. However, as soon as JIRA sees http, it interprets the rest of the line, until it reaches a whitespace character, as part of the URL - turning it into a link and URL encoding it. This is a problem because, being the literal value of a database field update, it is terminated with a single quote, which in turn is being (wrongly) encoded as '.

Example: update field1 set value='http://some.url.com/some/path/to/file.html'

EDIT: the above example looks fine here, but if I do the same thing in a JIRA comment or ticket description, it will come out looking like update field1 set value='http://some.url.com/some/path/to/file.html'.

4 answers

1 accepted

0 votes
Answer accepted
Neil Silverman September 5, 2013

Ok, so, I actually did end up answering my own question here. The issue I had was that my system was NOT set up to use the wiki style renderer for description or comment fields, but the default text renderer. Justin was on the right track, but just didn't go far enough in his explanation of field renderers. Once I changed the renderer, I can now enclose my SQL statements in {noformat} or {code} tags and I'm happy.

2 votes
Jason Cheng May 11, 2021

Stop parsing my URLs!! 

When I type https://www.xxxx.com/ I expect to see exactly that; we are often developing platforms so seeing the exact URL "as is" is extremely important. 

2 votes
Justin Alex Paramanandan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 27, 2013

Or how about using the {noformat} macro to wrap your SQL command:

{noformat}
update field1 set value='http://some.url.com/some/path/to/file.html'
{noformat}

The {noformat} is a Wiki-text renderer setup that can be used for Free Text fields, comments and Descriptions.

1 vote
Faisal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 18, 2013

Dear Neil,

Probably you can try to use the URL macro to limit the URL, for an example:
update field 1 set value = [http://some.url.com/some/path/to/file.html]

I hope that this will help!

Neil Silverman June 18, 2013

Nope, that does not work. Keep in mind this is JIRA, not confluence. This is from a sample ticket in my JIRA system:

If I just put in the update statement as written:

UPDATE `sbdb`.`sb_preferences` SET P_VALUE='https://mservices.meijer.com/OptInOutServiceExt/PreferenceManagementService.svc' WHERE P_LABEL='apiUrl' AND P_NODE='//COM/soundbite/ApiWorkerModule/MEIJER_PREFMGMT';

If I try to enclose the URL portion in square brackets:

UPDATE `sbdb`.`sb_preferences` SET P_VALUE='[https://mservices.meijer.com/OptInOutServiceExt/PreferenceManagementService.svc]' WHERE P_LABEL='apiUrl' AND P_NODE='//COM/soundbite/ApiWorkerModule/MEIJER_PREFMGMT';

Note that while I no longer get the single quote being URL encoded to ', I now have square brackets in my quoted string, which is also incorrect. So I'm still looking for a solution.

Neil Silverman June 24, 2013

Note that I still haven't received an answer to this question. Commenting here for additional attention. I have also opened a support ticket.

Faisal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 27, 2013

Dear Neil,

I am sorry to know that the problem still remains on your end.

Looking at your responses above, I see that you tried to update the field value with the URL directly from the database level. However, I see that the table that you want to update is sb_preferences, which I am afraid is not the default JIRA table.

And also, may I know which field in JIRA that is used to contain the URL?

Note that for JIRA fields (or custom fields) that is using the Wiki Style renderer, supposedly we should be able to use bracket on and off to limit the URL entered in the field. Reference: https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=links

Thanks,
Ahmad

Suggest an answer

Log in or Sign up to answer