Hi All,
I would like to know is there a way to disable only "Add version" function in 'Versions' tab and rest all functions (merge, release, edit, archive and delete) should still work.
Background: I wanted to customize add version function so I have written a new plug-in and I want all users to go through the new customized version creation flow and want to disable the jira standard flow.
Kindly let me know if anybody have an idea.
Thanks,
Vinutha
Hi Vinutha,
I have a java script based solution but it's not optimal since the table object is something that is created dynamically after the DOM ready event and i do not know yet how to hook in there. So i remove the "Add version" row just 500 ms after the DOM has been loaded and if you have good eyes you can see it flickering ... ;)
Just put this script in the announcement banner:
<script> function hideAddVersion(){ AJS.$(".project-config-versions-add-fields").remove(); } AJS.$(document).ready(function(){ setTimeout('hideAddVersion()',500); }); </script>
Hi Dieter,
I tried the above JS solution to hide add version row from version screen .
But the problem is ".project-config-versions-add-fields" id is used in component creation page also for creating a component. Ideally JIRA should have used 2 different id's for version and component creation but unfortunately not.:(
So above solution is hiding both the functions but I am interested in only removing version creation.
Is there any other way without changing the source code of project-config-plugin?
Thanks,
Vinutha
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.
Hi Dieter,
Did you get a chance to have a look? Kindly let me know if you figure out any solution.
Thanks,
Vinutha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, here we go:
<script> function hideAddVersion() { AJS.$(".project-config-versions-add-fields").remove() } (function($){ function delayedHideAddVersion() { setTimeout('hideAddVersion()',500) } $(document).ready(function(){ url = window.location.pathname; filename = url.substring(url.lastIndexOf('/')+1); if (filename == "versions") { console.log(window.location.href) delayedHideAddVersion(); } }); })(AJS.$); </script>
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.
Hi Dieter,
Yes. Your solution resolved my problem. Than you so much.
Thanks,
Vinutha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dieter,
Above java script to hide 'Add version' function working fine in Mozilla or Chrome but facing problem in IE.
If I set this script in Announcement banner, JIRA dashboards are not loading in IE :(.
It is displaying only header and footer. No body content.
Any idea?
Thanks,
Vinutha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dieter,
As per view source and error line number, It is throwing error @ line “url = window.location.pathname” in the script.
Webpage error details
Message: Object doesn't support this property or method
Line: 278
Char: 7
Code: 0
URI: http://jira-dev:8095/secure/Dashboard.jspa
<br< a="">>
Thanks
Vinutha
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.
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.
Hi Dieter,
I tried increasing timeout to 5000 but still not working.
Could you please pass me your email id, so that I can send you the screen shots.
Jira instance I am running is jira4.4 and IE is 8.
Thanks,
Vinutha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dieter,
I am planning to move the above javascript function from announcement banner and trying to load the javascript in a plugin as webresource module.
I tried as per the instructions available @ https://developer.atlassian.com/display/JIRADEV/Web+Resource+Plugin+Module
Below is the implementation detail,
1. web-resource enty in atlassian-plugin.xml
<web-resource key="hideVersionCreationForm" name="HideVersionCreationForm" >
<resource type="download" name="hideVersionCreationForm.js"
location="includes/js/hideVersionCreationForm.js" />
<context>atl.admin</context>
</web-resource>
2. hideVersionCreationForm.js file
function hideAddVersion() {
AJS.$(".project-config-versions-add-fields").remove()
}
(function($){
function delayedHideAddVersion() {
setTimeout('hideAddVersion()',500)
}
$(document).ready(function(){
var url = window.location.pathname;
filename = url.substring(url.lastIndexOf('/')+1);
if (filename == "versions") {
console.log(window.location.href)
delayedHideAddVersion();
}
});
})(AJS.$);
3. Calling requiredResource method
The reference to WebResourceManager
can is injected into your constructor and callingwebResourceManager.requireResource.. in the doDefault as shown below,
webResourceManager.requireResource("version.management.plugin:hideVersionCreationForm");
Please let me know if I am doing anything wronge here, I am not able to see the javascript working with this approch. But if I put the same js in announcment banner its working fine.
Thanks,
Vinutha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
just for my curiousity: How do your get your new plugin installed in onDemand? Isn't that restricted to some plugins? Or is it a Speak-Easy-Plugin?
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.