Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Hide "Configure Fields" Button only for certain issue types

Hello,

 

Is there a way to hide configure fields only for certain issue types? 

 

Regards,

Vidhya

1 answer

1 accepted

0 votes
Answer accepted
Nir Haimov Community Leader Oct 30, 2020

Hi @Vidhya Mohan 

Can you please share screenshot and elaborate more?

What you mean  by "configuration field"?

@Nir Haimov , I'm talking about "Configure Fields" on the Create Issue page.  I want that to appear/disappear based on issue types selected

Nir Haimov Community Leader Oct 30, 2020

Ohhh
I get it now.

No, you can't set such a thing, there is no such built-in option, but it is possible to write a JS to hide it when you want.

I'm not well versed with coding. Is it possible to give me a JS which check the issue types and then disables the configure fields 

Nir Haimov Community Leader Oct 30, 2020

Hi @Vidhya Mohan 

this will work for you

if ($("#issuetype-field").val() == "Task" || $("#issuetype-field").val() == "Bug")
$("#qf-field-picker-trigger").remove()

But if you are no coding, so you probably don't know where to put it either... 

Thanks @Nir Haimov . Will this code work. I've figured out where to put this piece of code though :) 

 

<script type="text/javascript">
(function($) {
AJS.toInit(function(){
// init on load
if ($("#issuetype-field").val() == "Test" || $("#issuetype-field").val() == "Test Plan") || $("#issuetype-field").val() == "Test Set") || $("#issuetype-field").val() == "Test Execution") || $("#issuetype-field").val() == "Pre-Condition")
AJS.$("#qf-field-picker-trigger").hide();
})
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
// init on refresh
if ($("#issuetype-field").val() == "Test" || $("#issuetype-field").val() == "Test Plan") || $("#issuetype-field").val() == "Test Set") || $("#issuetype-field").val() == "Test Execution") || $("#issuetype-field").val() == "Pre-Condition")
AJS.$("#qf-field-picker-trigger").hide();
});
})(AJS.$);
</script>

Nir Haimov Community Leader Nov 01, 2020

Hi @Vidhya Mohan 

I would suggest you to use this code instead :)

(function ($) {
AJS.toInit(function () {
// init on load
var issueTypes = ["Test", "Test Plan", "Test Set", "Test Execution", "Pre-Condition"];
if (issueTypes.includes($("#issuetype-field").val()))
AJS.$("#qf-field-picker-trigger").hide();
})
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
// init on refresh
if (issueTypes.includes($("#issuetype-field").val()))
AJS.$("#qf-field-picker-trigger").hide();
});
})(AJS.$);

 Try it out, if it works for you, please mark my solution as the answer

Hello @Nir Haimov , the code is working only for 'Test' and is not working for any of the above mentioned issue types

Nir Haimov Community Leader Nov 02, 2020

Hi @Vidhya Mohan 

I tested it and it works fine for all issue types.
Where did you put your script?

Hello @Nir Haimov ,

I had put the script in field configuration of 'Test' issue type. - under 'Description' field

Regards,

Vidhya

Nir Haimov Community Leader Nov 02, 2020

Hi @Vidhya Mohan 

Does all your "test" issue types, are under the same field configuration?

Hello @Nir Haimov ,

eeks. no. so I should put in all the different screen config? 

Nir Haimov Community Leader Nov 02, 2020

Hi @Vidhya Mohan 

Exactly :)

Hello @Nir Haimov ,

 

Create issue is not working now when I update in all the required FCs. Any suggestions?

The screen stays as below. 

 

Regards,

Vidhyaimage.png

Nir Haimov Community Leader Nov 02, 2020

Hi @Vidhya Mohan 

Check for errors in the dev tools and let me know

Like Stuart C likes this

Below are the issue types configured in my project.. I want "Configure Fields" to appear only for bug

 

image.png

Like Stuart C likes this
Nir Haimov Community Leader Nov 02, 2020

I understand, but i need you to open the browser dev tool (click F12) and see if there are errors that cause your create screen to not show (as you sent before)

Like Stuart C likes this

Hello @Nir Haimov 

Received error like this. and the page is still loading. 

 

Regards,

Vidhya

 

 

image.png

Like Stuart C likes this
VM3731:10 Uncaught ReferenceError: issueTypes is not defined
at HTMLDocument.eval (eval at globalEval (batch.js?locale=en-UK:33), <anonymous>:10:9)
at HTMLDocument.dispatch (batch.js?locale=en-UK:44)
at HTMLDocument.v.handle (batch.js?locale=en-UK:44)
at Object.trigger (batch.js?locale=en-UK:44)
at Object.c.event.trigger (batch.js?locale=en-UK:64)
at HTMLDocument.<anonymous> (batch.js?locale=en-UK:44)
at Function.each (batch.js?locale=en-UK:33)
at c.fn.init.each (batch.js?locale=en-UK:29)
at c.fn.init.trigger (batch.js?locale=en-UK:44)
at Object.i.trigger (batch.js?locale=en-UK:572)
eval @ VM3731:10
dispatch @ batch.js?locale=en-UK:44
v.handle @ batch.js?locale=en-UK:44
trigger @ batch.js?locale=en-UK:44
c.event.trigger @ batch.js?locale=en-UK:64
(anonymous) @ batch.js?locale=en-UK:44
each @ batch.js?locale=en-UK:33
each @ batch.js?locale=en-UK:29
trigger @ batch.js?locale=en-UK:44
i.trigger @ batch.js?locale=en-UK:572
(anonymous) @ batch.js?locale=en-UK:790
dispatch @ batch.js?locale=en-UK:44
v.handle @ batch.js?locale=en-UK:44
trigger @ batch.js?locale=en-UK:44
c.event.trigger @ batch.js?locale=en-UK:64
(anonymous) @ batch.js?locale=en-UK:44
each @ batch.js?locale=en-UK:33
each @ batch.js?locale=en-UK:29
trigger @ batch.js?locale=en-UK:44
_setContent @ batch.js?locale=en-UK:2946
_setContent @ batch.js?locale=en-UK:3122
(anonymous) @ batch.js?locale=en-UK:603
(anonymous) @ batch.js?locale=en-UK:2946
(anonymous) @ batch.js?agile_global_admin_condition=true&jag=true&jaguser=true&jira.create.linked.issue=true&locale=en-UK&richediton=true&user-logged-in=true:6398
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
(anonymous) @ batch.js?agile_global_admin_condition=true&jag=true&jaguser=true&jira.create.linked.issue=true&locale=en-UK&richediton=true&user-logged-in=true:6398
c @ batch.js?locale=en-UK:44
add @ batch.js?locale=en-UK:44
(anonymous) @ batch.js?agile_global_admin_condition=true&jag=true&jaguser=true&jira.create.linked.issue=true&locale=en-UK&richediton=true&user-logged-in=true:6398
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
a.<computed> @ batch.js?locale=en-UK:44
(anonymous) @ batch.js?agile_global_admin_condition=true&jag=true&jaguser=true&jira.create.linked.issue=true&locale=en-UK&richediton=true&user-logged-in=true:6359
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
complete @ batch.js?agile_global_admin_condition=true&jag=true&jaguser=true&jira.create.linked.issue=true&locale=en-UK&richediton=true&user-logged-in=true:6359
i @ batch.js?locale=en-UK:594
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
u @ batch.js?locale=en-UK:44
(anonymous) @ batch.js?locale=en-UK:44
load (async)
send @ batch.js?locale=en-UK:44
ajax @ batch.js?locale=en-UK:44
m.makeRequest @ batch.js?locale=en-UK:594
refresh @ batch.js?agile_global_admin_condition=true&jag=true&jaguser=true&jira.create.linked.issue=true&locale=en-UK&richediton=true&user-logged-in=true:6359
getUseConfigurableForm @ batch.js?agile_global_admin_condition=true&jag=true&jaguser=true&jira.create.linked.issue=true&locale=en-UK&richediton=true&user-logged-in=true:6359
render @ batch.js?agile_global_admin_condition=true&jag=true&jaguser=true&jira.create.linked.issue=true&locale=en-UK&richediton=true&user-logged-in=true:6398
content @ batch.js?agile_global_admin_condition=true&jag=true&jaguser=true&jira.create.linked.issue=true&locale=en-UK&richediton=true&user-logged-in=true:6398
builder @ batch.js?locale=en-UK:2946
_setContent @ batch.js?locale=en-UK:2946
_setContent @ batch.js?locale=en-UK:3122
(anonymous) @ batch.js?locale=en-UK:603
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
a.<computed> @ batch.js?locale=en-UK:44
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
l @ batch.js?locale=en-UK:106
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
a.<computed> @ batch.js?locale=en-UK:44
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
a.<computed> @ batch.js?locale=en-UK:44
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
(anonymous) @ batch.js?locale=en-UK:106
(anonymous) @ batch.js?locale=en-UK:82
Y @ batch.js?locale=en-UK:82
Z @ batch.js?locale=en-UK:82
F.resolve @ batch.js?locale=en-UK:82
Y @ batch.js?locale=en-UK:82
(anonymous) @ batch.js?locale=en-UK:82
(anonymous) @ batch.js?locale=en-UK:82
(anonymous) @ batch.js?locale=en-UK:82
Y @ batch.js?locale=en-UK:82
Z @ batch.js?locale=en-UK:82
F.resolve @ batch.js?locale=en-UK:82
Y @ batch.js?locale=en-UK:82
Z @ batch.js?locale=en-UK:82
F.resolve @ batch.js?locale=en-UK:82
al @ batch.js?locale=en-UK:82
(anonymous) @ batch.js?locale=en-UK:88
Y @ batch.js?locale=en-UK:82
Z @ batch.js?locale=en-UK:82
F.resolve @ batch.js?locale=en-UK:82
(anonymous) @ batch.js?locale=en-UK:88
n @ batch.js?locale=en-UK:88
aa @ batch.js?locale=en-UK:82
load (async)
loadScript @ batch.js?locale=en-UK:82
e @ batch.js?locale=en-UK:88
d @ batch.js?locale=en-UK:88
load @ batch.js?locale=en-UK:88
(anonymous) @ batch.js?locale=en-UK:82
H @ batch.js?locale=en-UK:82
fetchDep @ batch.js?locale=en-UK:82
Z @ batch.js?locale=en-UK:82
getDeps @ batch.js?locale=en-UK:82
(anonymous) @ batch.js?locale=en-UK:82
H @ batch.js?locale=en-UK:82
w @ batch.js?locale=en-UK:82
K @ batch.js?locale=en-UK:82
_processResourceResponse @ batch.js?locale=en-UK:106
(anonymous) @ batch.js?locale=en-UK:106
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
u @ batch.js?locale=en-UK:44
(anonymous) @ batch.js?locale=en-UK:44
load (async)
send @ batch.js?locale=en-UK:44
ajax @ batch.js?locale=en-UK:44
_getScriptsForResources @ batch.js?locale=en-UK:106
(anonymous) @ batch.js?locale=en-UK:106
_enqueueRequest @ batch.js?locale=en-UK:106
_resolveAsync @ batch.js?locale=en-UK:106
n @ batch.js?locale=en-UK:106
require @ batch.js?locale=en-UK:106
WRM.require @ batch.js?locale=en-UK:109
downloadResources @ batch.js?locale=en-UK:2946
show @ batch.js?locale=en-UK:2946
c @ batch.js?agile_global_admin_condition=true&jag=true&jaguser=true&jira.create.linked.issue=true&locale=en-UK&richediton=true&user-logged-in=true:6428
d @ batch.js?agile_global_admin_condition=true&jag=true&jaguser=true&jira.create.linked.issue=true&locale=en-UK&richediton=true&user-logged-in=true:6425
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
a.<computed> @ batch.js?locale=en-UK:44
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
l @ batch.js?locale=en-UK:106
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
a.<computed> @ batch.js?locale=en-UK:44
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
a.<computed> @ batch.js?locale=en-UK:44
c @ batch.js?locale=en-UK:44
add @ batch.js?locale=en-UK:44
(anonymous) @ batch.js?locale=en-UK:106
c @ batch.js?locale=en-UK:44
fireWith @ batch.js?locale=en-UK:44
u @ batch.js?locale=en-UK:44
(anonymous) @ batch.js?locale=en-UK:44
load (async)
send @ batch.js?locale=en-UK:44
ajax @ batch.js?locale=en-UK:44
_getScriptsForResources @ batch.js?locale=en-UK:106
(anonymous) @ batch.js?locale=en-UK:106
_enqueueRequest @ batch.js?locale=en-UK:106
_resolveAsync @ batch.js?locale=en-UK:106
n @ batch.js?locale=en-UK:106
require @ batch.js?locale=en-UK:106
WRM.require @ batch.js?locale=en-UK:109
(anonymous) @ batch.js?agile_global_admin_condition=true&jag=true&jaguser=true&jira.create.linked.issue=true&locale=en-UK&richediton=true&user-logged-in=true:6425
c._clickHandler @ batch.js?locale=en-UK:808
dispatch @ batch.js?locale=en-UK:44
v.handle @ batch.js?locale=en-UK:44
Show 92 more frames
Like Stuart C likes this
Nir Haimov Community Leader Nov 02, 2020

@Vidhya Mohan  try to put this line:

var issueTypes = ["Test", "Test Plan", "Test Set", "Test Execution", "Pre-Condition"];

Also inside "Jira.bind" before the "if" statement

Like Stuart C likes this

Hello @Nir Haimov 

Like this?

 

<script type="text/javascript">
(function ($) {
AJS.toInit(function () {
// init on load
var issueTypes = ["Test", "Test Plan", "Test Set", "Test Execution", "Pre-Condition"];
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context){
if (issueTypes.includes($("#issuetype-field").val()))
AJS.$("#qf-field-picker-trigger").hide();
});
})
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
// init on refresh
if (issueTypes.includes($("#issuetype-field").val()))
AJS.$("#qf-field-picker-trigger").hide();
});
})(AJS.$);
</script>
Like Stuart C likes this
Nir Haimov Community Leader Nov 02, 2020

Hi @Vidhya Mohan 

Like this:

(function ($) {
AJS.toInit(function () {
// init on load
var issueTypes = ["Test", "Test Plan", "Test Set", "Test Execution", "Pre-Condition"];
if (issueTypes.includes($("#issuetype-field").val()))
AJS.$("#qf-field-picker-trigger").hide();
})
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) {
// init on refresh
var issueTypes = ["Test", "Test Plan", "Test Set", "Test Execution", "Pre-Condition"];
if (issueTypes.includes($("#issuetype-field").val()))
AJS.$("#qf-field-picker-trigger").hide();
});
})(AJS.$);
Like # people like this

Thank you @Nir Haimov . It worked :) 

Like Stuart C likes this

@Nir Haimov

This javascript is suddenly not working. It is getting displayed on the screen (screenshot below)

Any idea why this is happening suddenly?  Version of JIRA - v 8.13.2

image.png

Nir Haimov Community Leader Jan 29, 2021

Hi @Vidhya Mohan 

Please check Jira admin settings if maybe HTML support in custom field description turned off.

Like Vidhya Mohan likes this

But it is hiding for all users, is there way we can hide only for users not for admins ?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

314 views 9 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you