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

How to temporarily disable some shortcut keys in Jira using AUI

Hello everybody,

I would like to temporarily disable some shortcut keys in Jira using the AUI library.

In my specific case, I would like to disable the "m" key (comment issue) in some workflow steps.

I tried this without success:

if (AJS.$("#status-val").text().trim() == "blablabla") {
  //alert("Blocking comments...");
  AJS.$("#comment-issue").hide(); //OK
  AJS.$("#footer-comment-button").hide(); //OK
  AJS.whenIType("m").execute(function(){}); //NOK, the "m" key continues reacting to the comment operation
}

Also, I installed and tried without success the JS Shortcut Library plugin (http://www.stepanreznikov.com/js-shortcuts/):

<script type="text/javascript" src="/jira/includes/js/plugins/js-shortcuts/jquery.shortcuts.min.js"></script>

if (AJS.$("#status-val").text().trim() == "blablabla") {
  //alert("Blocking comments...");
  AJS.$("#comment-issue").hide(); //OK
  AJS.$("#footer-comment-button").hide(); //OK
  AJS.$.Shortcuts.remove({type: 'hold',mask: 'm'}); //NOK, the "m" key continues reacting to the comment operation
}

So, why the right way to acomplish this issue?

1 answer

Did you try with the last Jira? This seems to work fine now (Jira 6.0.6)!

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Posted yesterday in United States

Atlassian Government Symposium

Good day members, Not sure if you are aware that Atlassian will be hosting a Government Symposium on May 1st, 2019 in Washington DC. For more details please click here If you have any questions...

14 views 0 0
View post

Atlassian User Groups

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!

Find my local user group

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

Groups near you