Hi,
I need to make a textfield(custom field) invisible in the "create/edit issue" mask as it provides a plugin with information that users don't need to see. Any idea how to do it in JIRA 6.0?
In JIRA 5.2.x I could use JIRA Toolkit Plugin to add a "Message Custom Field (for edit)" that make the textfield invisible with css.
Community moderators have prevented the ability to post new answers.
add the following code in field description of the specific issuetype field configuration
<script type="text/javascript"> jQuery(document).ready(function($) { JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) { $('#customfield_10837').closest('div.field-group').hide(); }); }); </script>
I put the code in like every description because I wasn't sure if I understood you exactly. Was it ( Issues -> Fields -> Field Configuration -> "Configure" -> MyField "Edit" ) ?
I tested it with JIRA 5.1.8 and 6 and it doesn't work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HTML-Code (field still visible):
<div class="field-group" > <label for="customfield_10000">HiddenLinkID</label> <input class="textfield text long-field" id="customfield_10000" name="customfield_10000" maxlength="254" value="" type="text"> <div class="description">
<script type="text/javascript">
jQuery(document).ready(function($) { JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) { $('#customfield_10000').closest('div.field-group').hide(); }); }); </script> </div> </div>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if you want to hide the text field for specific issutype issues then you have to add the code on that issuetype field configuration.
another way you can include js in plugin as webresorce , 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.
So, I added a new web-resources:
<web-resource name="create_linked_action_hide" i18n-name-key="create_linked_action_hide.name" key="create_linked_action_hide"> <dependency>jira.webresources:global-static</dependency> <description key="create_linked_action_hide.description" /> <resource name="hide" type="download" location="/js/hide.js"/> <context>atl.general</context> </web-resource>
hide.js:
jQuery(document).ready(function($) { JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) { $('#customfield_10000').closest('div.field-group').hide(); }); });
I can still see the field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So, is this code ok? How is this hide.js even triggered? On every event in JIRA?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
your code looks good and it should work!!!
yes, it will triggered when page loads and on popup, you can check this by giving alerts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok it's working, but only if I create an issue in a dialog.
If I open the "Create Issue"-Screen in a new tab I can see the field. Any idea how to hide it there?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok I used a example from an other question, so it also works while in a new tab.
jQuery(document).ready(function($) { function hide() { $('#customfield_10000').closest('div.field-group').hide(); } hide(); JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e, context) { hide(); }); });
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
glad to hear it worked!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use Javascript to block it out:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I need a web-resource in my plugin. I have like 0 JavaScript experience. Could anyone tell me how the JavaScript would look like if I wanted to make a field invisible? And how do I trigger it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tomasz,
Not sure if I understand your requirement correctly. But if you are just looking at hiding a field from the create/edit/view issue screen, you must be removing that field from the screen that your project's screen scheme is using.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I write information to this textfield over the url. If I hide it it doesn't exist and therefor I can't write sth to it.
The field needs to be in the mask, but invisible for the user.
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.