UI builder client script to hide attachments icon when state is closed
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 11:47 PM
I need a functionality in my workspace such that if I close the ticket ,the attachments icon should not be visible , I went to UI builder open the attachments tab wrote a script over there
function evaluateProperty({api, helpers}) {
// Fetch the current state of the ticket
const currentState = api.state.record['state'];
// Check if the state is 3
if (currentState === 3) {
return false; // Hide the attachment icon
}
return true; // Show the attachment icon for all other states
}
but this seems not working for me , can anyone help in syntax of this script
0 REPLIES 0