how to use sqlprocessor or ao in javascript

Hi Friends,

I have created webresource plugin module to remove issuetypes in javascript I want to retrive jira database values using sqlprocessor or ao,

How would I use database values in IssueTypesResctictor.js ?


<web-resource key="IssueTypesRestrictor-js" name="javascript">
        <resource name="IssueTypesRestrictor.js" type="download" location="js/IssueTypesRestrictor.js" />


JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) {
function hide()
        $("#issuetype option").each(function()
                	if($.trim($(this).text()) == 'Bug')


Thanks in advance


Best Regards

Onkar Ahire

2 answers

1 accepted

0 votes
Accepted answer

create your own rest api using REST plugin module and implement all you logic in that rest

so later you can call that rest in javascript file

check this for rest plugin module

@Rambanam as you said to use rest api , can we retrive db values in restapi ?

yes, you can retrive db values using JDBC or by using JNDI configuration.

It seems you are trying to hide certain issue types .

Good way to do is use behaviours plugin and write a groovy script .

Thanks Mizan I appriciate it is possible using groovy script and behaviour plugin, Above script is hardcoded.

I am writing a plugin which will save restricted issue types in database using project specific configuration(project-tab-panel) and while creating an issue it will run the above script and validate the restricted issue types which saved in database and remove that issuetypes from issuetypes field but seems it might not possible to use sqlprocessor or ao,

so moving a head I got an idea to write a plugin to extend the capabilities for creating issue, there I can use sql processor or ao at the time of validation and use addfielderror message if issue type is restricted for specific user/roles(restricted issue types will be saved in db as a configuration of project) but again here I stuck with

Can anyone suggest solution?


Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,187 views 5 10
Read article

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