I am using watcher plugin. So I created new created new field called "watcher"(Watcher type field) through this plugin. It works great providing features like adding watchers anytime and for some automations.
We are planning to use this watcher field for browse permission. In order to avoid any confusion, I want to hide the default watchers field. Is there a way to hide this using velocity templates?
I am not sure about editing the velocity template as a means to hide this information in Jira. That approach might be possible to do as well.
In my testing I found that I could hide the default Watcher field on issue details view with the script of:
AJS.$('#peoplemodule > div.mod-content > ul:nth-child(2) > li > dl:nth-child(2) > dt').hide();
It's possible that your #peoplemodule entry might be different. I'm afraid that the watcher elements don't exactly have an explicit selector name/id, which makes it a bit more tricky to hide these with a script. If you're Jira instance has more elements under this People section, say because you might be using another plugin to Jira, then then one of the nth-child attributes might be a different number for your Jira instance.
Yes, that is true. This just hides this element from being displayed on the web page. It does not disable any REST functionality with Jira. So yes, a REST user could still use/see this watcher information.
What I did was to click and select this part of the page itself, then right click and select the Inspect option in my browser. I know Chrome and Firefox have this option to show you the html code of the page. From there it is a matter of finding the selector tags in the code in order to hide those elements.
This is great. Thanks for explaining and pointing to the kb article. I have tested this in my sandbox environment. It works both in field and announcement banner. For some reason it doesn't work in custom field in production but works in announcement banner.
So I am assuming nth child element is correct but it is not rendering through the custom field?
I used a custom field to do this because I knew I could control exactly which screens in Jira this custom field would appear on. That might be why that doesn't work in your environment. If the screen you are using in Jira does not yet contain that custom field, then the script does actually get injected into the page display this way.
It is working ok. But the drawback is after entering the value in the custom field and saving makes the default watchers field visible.
Reloading the page will hide the default watchers again. Is there a way to not show the default watchers after saving the custom watcher field?
Atlassian Summit is an excellent opportunity for in-person support, training, and networking.Learn more
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!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG