- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 10:07 PM
I have a requirement to make the republish button visible to members of ownership group .
Currently only admins can see this button
Condiiton of UI Action
!(new KBCommon().isStackNameDialog()) && (new KBKnowledge().canRepublish(current))
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2023 12:35 AM
@avinashdubey103 no problely not because the publish function "new KBKnowledge().republish(current);" in the UI Action also checks if you can republish which would not work with your function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 10:30 PM
You can overwrite the behaviour in Script Include KBCommon with function "canRepublishKnowledge". Please test the following
var KBCommon = Class.create();
KBCommon.prototype = Object.extendsObject(KBCommonSNC, {
type: 'KBCommon',
canRepublishKnowledge: function(itemGr) {
// Case 1: Pass in a valid value
if (!itemGr)
return false;
// Case 2: If the record is retired continue
if (itemGr.workflow_state != "retired")
return false;
// Case 3: If user is admin continue
// Customization: Ownership group should be possible to republish article
if (!this.isAdminUser(itemGr) && !this.isGroupMemberOrManager(itemGr[this.OWNERSHIP_GROUP]))
return false;
// Default: Allow user to republish knowledge
return true;
},
});
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2023 12:12 AM
i am trying to implement this as dot walkling :in the UI Action condition
gs.getUser().isMemberOf(current.kb_knowledge.ownership_group)
not sure is it possible ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2025 07:50 AM
Hi @Sebastian
Your solution is worked for me, but i want to understand the functionality behind this or connection of script includes, I have posted seprate post on this colud you please go to below article and help me to undertand this?
Thank you
https://www.servicenow.com/community/itsm-forum/knowledge-article/m-p/3301626#M542661
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2023 12:35 AM
@avinashdubey103 no problely not because the publish function "new KBKnowledge().republish(current);" in the UI Action also checks if you can republish which would not work with your function.