Hi Team,
We have decided to hide the edit button for closed tickets. For that I've put one javascript code in announcement banner below and it's not working well. Could you please assist the right code to hide the edit button based on status.
<script type="text/javascript">
(function($) {
AJS.toInit(function(){
// init on load
project = AJS.Meta.get("issue-key").substr(0, AJS.Meta.get("issue-key").indexOf('-'));
if (project == "xxx") {
AJS.$("a#edit-issue").hide();
console.log("HIDE");
}
else {
AJS.$("a#edit-issue").show();
console.log("VISIBLE");
}
});
})(AJS.$);
</script>
Thanks,
Tej
Hi, @badana_teja !
I strongly recommend you to use workflow properties(jira.issue.editable).
Look through the documentation.
I agreed that workflow properties will work definitely, but when we use properties users cannot update the worklogs any more. But we have one scenario, that if user want to change his/her worklogs on that closed tickets then there is no option to modify worklog as that will be also hide as part of edit restriction. So using announcement banner, we can hide only edit button and worklog option will be visible as normal. So please assist on that script to hide edit button for closed status tickets.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it popular case?
For example you can create new group to editors(1-2 users) and use properties like I already sent before:
jira.permission.edit.group=jira-editors
Yes, they can be able to edit issue attributes too, but it is better than banner in my opinion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, it is now popular case. If user want to modify the worklog after closing ticket then there is no option if we put restriction. Also based on this worklogs only the productivity will be calculated. It's not about the editors. I just thinking that only owner of the ticket should log work. If we restrict edit then worklog option also will be unavailable. So our expectation is restricting edit option for closed status tickets and allowing owners to log/modify their worklogs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.