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 ?
atlassian-plugin.xml***********************************************************
<web-resource key="IssueTypesRestrictor-js" name="javascript"> <dependency>jira.webresources:global-static</dependency> <description>JavaScript</description> <resource name="IssueTypesRestrictor.js" type="download" location="js/IssueTypesRestrictor.js" /> <context>atl.general</context> <context>atl.admin</context> </web-resource>
IssueTypesResctictor.js***********************************************************
jQuery(document).ready(function($) { JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e,context) { hide(); }); hide(); function hide() { $("#issuetype option").each(function() { if($.trim($(this).text()) == 'Bug') { $(this).remove(); } }); } });
***************************************************************************
Thanks in advance
&
Best Regards
Onkar Ahire
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
https://developer.atlassian.com/display/DOCS/REST+Plugin+Module
@Rambanam as you said to use rest api , can we retrive db values in restapi ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, you can retrive db values using JDBC or by using JNDI configuration.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It seems you are trying to hide certain issue types .
Good way to do is use behaviours plugin and write a groovy script .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 https://answers.atlassian.com/questions/222470/extend-the-capabilities-for-creating-issue
Can anyone suggest solution?
Thanks
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.