Hi Community,
I managed to hide the "delete" from the More Panel, but I can't write the Condition correctly, which will hide this element only on tickets that have a booked time. I imagined the script, but I need to get false whenever worklogged or timespent is greater than 0. Is this even possible?
Thanks in advance.
Best regards
I think that is possible, try something like:
import com.atlassian.jira.issue.*
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.worklog.Worklog
def issue = context.issue as Issue
def workLogManager = ComponentAccessor.getWorklogManager()
def logged = workLogManager.getByIssue(issue)
if ( logged!=null || logged>0) { rturn true}
else return false
I hope this help!
Hi David, thank you for you replay but we have a problem at the def issue
def issue = context.issue as Issue
For "issue" here is a Problem with
Variable "issue" masks a binding variable of the same name. Please choose a different name for variable: "issue". Can we try to fix it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hallo David,
i have it. This should be the Script that works 4 every one that searchs it its here:
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor
def workLogManager = ComponentAccessor.getWorklogManager()
def logged = workLogManager.getByIssue(issue)
if (logged != null && logged.size() > 0) { return false }
else return true
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.