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

This widget could not be displayed.

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.

This widget could not be displayed.
Mizan Community Champion Oct 14, 2013

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

99 views 1 0
Join discussion

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