We need certain fields Mandatory but they are only ever to be filled in by an internal service desk agent, not the customer. For example, we must fill in the Tempo Account field before the item is closed. The tempo account field will not be filled in by the customer but needs to be mandatory before an internal agent can close the ticket. We also need to do the same sort of thing for a custom field.
Outside of Service Desk, there are two options.
Making them always required would mean the customer would have to fill it out before they could submit their ticket, which we don't want them to fill out.
Unfortunately setting the Tempo Account field to required on Transition doesn't work as Tempo uses a default account of 'None' so the transition thinks the Account field has a value in it and doesn't stop the transition
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you on Cloud or Server? What add-ons do you have to augment workflow functions (JSUtil, Misc Workflow Extensions, Script Runner, etc)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We are on Server
JIRA Misc Workflow Extensions
Adaptavist ScriptRunner for JIRA
If I could somehow empty the Account field, at least then I could set the Account to Mandatory on the very last transition and it would work because JIRA would think it was actually empty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
image2016-10-4 11:12:3.png
image2016-10-4 11:12:58.png
But it still lets me resolve the item even though I haven't selected an Account:
image2016-10-4 11:13:27.png
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, it seems quite clear that the validator isn't working as intended with the Tempo field.
I don't see this bug listed in JIRA Suite Utilities or Misc Workflow Extensions, but I do find a reference in the Tempo Timesheets project – TT-3369. There seems to be little to no movement on the issue, and in fact was just closed.
The Tempo bug seems to detail that the validator works when no screen is present, but fails (passes) when the Tempo Account field is on-screen.
I would like to poke at this with scriptrunner myself. I'm sure we can write something simple that does the job. I can't promise a solution or a timeframe though.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is one we tried but with no luck
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.web.bean.PagerFilter
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import groovyx.net.http.RESTClient
import com.tempoplugin.accounts.account.*
Issue issue = issue
def issueManager = ComponentAccessor.getIssueManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def cFieldObject = customFieldManager.getCustomFieldObject("customfield_10105")
def cFieldValue = cFieldObject.getValue(issue)//issue.getCustomFieldValue(cFieldObject)
if(cFieldValue.toString()== 'none' || cFieldObject.getValue(issue).toString() == null) 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
and logged a ticket with JMWE, hopefully one of them can fix it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.