I used to put HTML tags on many custom field descriptions on JIRA 5 with no problem whatsoever, they always worked like what's described in here:
https://confluence.atlassian.com/display/JIRA/Displaying+a+Field+Based+on+Another+Field+Selection
However, when I upgraded to JIRA 6.1, the tags are not changing anything on the page. Insteadm they just show up in the description as raw HTML code. On the page's source code, the tags are shown as, e.g., </script>. And I can't seem to find any documentation stating specifically that HTML on field descriptions are not supported anymore. Are they really not supported, or is something wrong with my JIRA?
AFAIK, from JIRA 6 on plugin custom fields are not allowed anymore to support HTML in the description for security reasons. It's only supported by the system fields and standard custom fields already provided by JIRA. (Reference: https://jira.atlassian.com/browse/JRA-28776)
That's exactly the problem, thank you. Kind of saddened by this, but it's no use complaining, as I see.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Just reading this thread, as I had the same problem as the first person.
What I just found out is that this is shit.... So any changes made to the field description in the "Custom Fields" screen is not translated to any of the "Field Configurations". So for every change made to a custom field, this change has to be made manually to every Field Configuration that uses this field.
Wow, that really sucks Atlassian...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm using a script (using script runner plugin) for populating all field configurations (and the field itself) with a new description. If someone is interested I could post it here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Henning,
I would appreciate getting a look at your script. Code examples go a long way toward helping me understand the intricacies of an implementation. Thank you for your time.
Sincerely,
Paul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Attached UpdateCustomfieldDescription.txt.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here you go...
import com.atlassian.jira.component.ComponentAccessor import com.atlassian.jira.exception.DataAccessException import com.atlassian.jira.issue.CustomFieldManager import com.atlassian.jira.issue.fields.CustomField import com.atlassian.jira.issue.fields.layout.field.* def cfName = 'Inhouse Customer' def cfDesc = '' FieldLayoutManager fieldLayoutManager = ComponentAccessor.getFieldLayoutManager() CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager() // get all existing FieldLayouts List<FieldLayoutScheme> fieldLayoutSchemes = fieldLayoutManager.getFieldLayoutSchemes() List<Long> fieldLayoutIds = [] fieldLayoutSchemes.each{ fieldLayoutScheme -> Collection<FieldLayoutSchemeEntity> fieldLayoutSchemeEntities = fieldLayoutScheme.getEntities() fieldLayoutSchemeEntities.each{ fieldLayoutSchemeEntitiy -> fieldLayoutIds << fieldLayoutSchemeEntitiy.getFieldLayoutId() } } fieldLayoutIds = fieldLayoutIds.unique() List<FieldLayout> fieldLayouts = fieldLayoutIds.collect{Long fieldLayoutId -> fieldLayoutManager.getFieldLayout(fieldLayoutId as Long)} // get custom field CustomField cfObj = customFieldManager.getCustomFieldObjectByName(cfName) // change description fieldLayouts.each{fieldLayout -> FieldLayoutItem fieldLayoutItem = fieldLayout.getFieldLayoutItem(cfObj) if (fieldLayoutItem) { try { if (!fieldLayout.isDefault()) { def efl = fieldLayoutManager.getEditableFieldLayout(fieldLayoutItem.getFieldLayout().getId()) efl.setDescription(fieldLayoutItem, cfDesc) fieldLayoutManager.storeEditableFieldLayout(efl) } else { def efdl = fieldLayoutManager.getEditableDefaultFieldLayout() efdl.setDescription(fieldLayoutItem, cfDesc) fieldLayoutManager.storeEditableDefaultFieldLayout(efdl) } } catch (DataAccessException e) { log.error "$e" } } } fieldLayoutManager.refresh()
Henning
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to adapt cfName and cfDesc and than run it in the script console (after testing it in a test environment).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you can try with following script
<script type="text/javascript"> jQuery(document).ready(function($) { JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) { showHideFieldFunction(); }); showHideFieldFunction(); function showHideFieldFunction(){ showHideField(); //select list $('#customfield_10933').change(function() { showHideField(); }); } function showHideField(){ var selectListSelectedValue=$("#customfield_10933 option:selected").text(); if(selectListSelectedValue == 'Yes'){ //Text area field $('#customfield_10934').closest('div.field-group').show(); }esle{ $('#customfield_10934').closest('div.field-group').hide(); } } }); </script>
the above script will work if add it on field description of the custom field in field configuration except in create screen
if you load this script as webresource module in plugin then it will work on create screen also
check this
https://answers.atlassian.com/questions/47843/strange-javascript-problem-in-create-screen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think that's the issue here. It's not only scripts that stop working, but any HTML tags at all. Even if I write <b>Something</b>, it will not show up as bold, it'll show the tags just like here.
Besides, if this was the problem, it would already have stopped working on JIRA 5, which was not the case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
we are using <a></a> and <div></div> tags to create help text in jira 6.1 and those are working fine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's on a field description, I presume. Strange, it doesn't work here at all... Might have something to do with some system configuration, then? I don't know where to look.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can you confirm this, did you added HTML code in field description on field configuration scheme right? and also on which screen you are testing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried both the original description and the field configuration description, both had the same result. I'm supposed to see the description both on the create issue and edit issue screens, but both show raw tags.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can you test as follows,
1. add the HTML content on field description in field configuration scheme
2. refresh the browser
3. check it on other than create screen
i have added <b>Prasad</b> on field description in field configuration, it is showing as bold text
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.