Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Required internal fields

Sarah Lincoln October 2, 2016

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 votes
Steven F Behnke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 2, 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).

 

Sarah Lincoln October 2, 2016

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 F Behnke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 2, 2016

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

Sarah Lincoln October 3, 2016

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.

Sarah Lincoln October 3, 2016

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 F Behnke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 3, 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.

Sarah Lincoln October 3, 2016

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

Sarah Lincoln October 3, 2016

I have logged a bug with Suite Utilities for Jira

Sarah Lincoln October 3, 2016

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events