Required internal fields

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.

1 answer

0 vote
Steven Behnke Community Champion Oct 02, 2016

Outside of Service Desk, there are two options.

  • You can make fields required always, by marking them as required on a Field Configuration.
  • You can make fields required during a transition screen, by using a Validator (provided by a plugin such as JIRA Suite Utilities or Misc Workflow Extensions).

 

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 sad 

Steven Behnke Community Champion Oct 02, 2016

Are you on Cloud or Server? What add-ons do you have to augment workflow functions (JSUtil, Misc Workflow Extensions, Script Runner, etc)

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.

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

Steven Behnke Community Champion Oct 03, 2016

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.

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

I have logged a bug with Suite Utilities for Jira

and logged a ticket with JMWE, hopefully one of them can fix it.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jun 14, 2018 in Jira Service Desk

How the Telegram Integration for Jira helps Sergey's team take their support efficiency to the bank

...+ reading Fantasy). The same is true for him at the bank he works for: Efficiency is key when time literally equals money. Read on to learn how Sergey makes most of the time he has by...

797 views 5 7
Read article

Atlassian User Groups

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!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you