Hello,
Very simple question, but I've been struggling with it for several hours already.
I want to hide one custom field from all screens using JS.
Here is fragment of atlassian-plugin.xml:
<web-resource key="S" name="S" ><resource type="download" name="a.js" location="js/a.js" />
<context>jira.view.issue</context>
</web-resource>
My JS a.js:
AJS.toInit(function(){
alert("Hello World");
AJS.$('#customfield_10120').closest('div.field-group').hide();
});
I've read dozens of corresponding forum's questions&solutions but nothing worked for me, field is not hidden.
What I'm missing?
Thanks in advance!
Finally I was able to resolve this riddle. The working js template is
AJS.toInit(function(){
var hideField = "#customfield_10121";
var elem = $(hideField + "-val");
var parent = elem.parent();
parent.remove();
});
CF 10121 has successfully been hidden.
Just in case someone needs: how to inject vars from Java class to JS inside velocity template:
#set ($CustomField=$CF)
<script type="text/javascript">
AJS.toInit(function(){
var hideField = "#" + "${CustomField}";
...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, custom field is not hidden, when issue is opened in Search query, but hidden when displayed as jira/browse/PRO1-1:
If someone know how to hide it (using js) in Search view, please, help.
Regards.
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.