I want to pass the below code as a description parameter when creating the custom field.
CustomField cField = CustomFieldManager.createCustomField(customfieldName, "FIELD DESCRIPTION: JAVA SCRIPT CODE HERE", customFieldManager.getCustomFieldType(customFieldTypeKey) , customFieldSearcher, contexts, issueTypes);
So I can only get the ID using cField.getID() after the field is created.
Hey Boris. Strangely enough I am able to set the Description of the field when I send some text in to cField.setDescription(someTextStringHere), however when the string holds some java script code (with proper formatted escape characters ofcourse) it does not show up in the acutal field description, while the text does show.
Any ideas if Jira even allows us to set java script as description via plugins or am I missing something?
Jira allows setting js code in the description. I think you do not need to escape it. The script will not show up in the description but it's there. You can do a simple test by putting <script>console.log('test message')</script> and check if it will show up in the browser console.
It's officially Tuesday, which means it's officially time for another tip to help you better navigate this space we call the Atlassian Community. 😄 I got a great question from community member, Sa...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs