Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Make a field mandatory based on another field

Alice
June 30, 2021

Hello need help please
I have to make the system field due date mandatory only if the custom field delivery date desired is filled. Here is my script:

import com.atlassian.jira.component.ComponentAccessor
import com.onresolve.jira.groovy.user.FormField
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.CustomFieldManager

def issueManager = ComponentAccessor.getIssueManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()


def desired_delivery_date = customFieldManager.getCustomFieldObject("customfield_12303")
def issueObject = issue
def duedate = issueObject.getDueDate()

if ( desired_delivery_date != null){
      duedate.setRequired(true)
}

 

When I execute this script I get this error : 

groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.issue.fields.ImmutableCustomField.setRequired() is applicable for argument types: (Boolean) values: [false] at Script1288.run(Script1288.groovy:21)

 

Thanks for your help

1 answer

1 accepted

1 vote
Answer accepted
EddieW
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 Champions.
September 22, 2013

No automated manner, but assuming all the tasks have been estimated you can just use multiple markers on the planning board, and assign each one the max velocity you feel your team can meet based on history.

As one sprint is completed the next marker will be waiting and ready to start.

BUt this is not really Agile/Scrum, which is all about adapting along the way. A simple Kanban board would probably work better for your team. (these are all the issues based on priority that must be done.)

https://confluence.atlassian.com/pages/viewpage.action?pageId=268046489

Dustin Johnson
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 22, 2017

Haha but what if your management won't let you use Kanban and makes you use sprints -_-'

Jose A. Herrero
November 7, 2017

You can fake Kanban way of working by creating one sprint from now to the delivery date (I think you need to have parallel sprints feature activated).

If your manager wants to have smaller sprints you can add all your stories to the board and move the ones that were not delivered by the end of the sprint to the next one. When you close a sprint JIRA asks you what do you want to do with the uncompleted stories.

 

I hope this is helpful. 

Suggest an answer

Log in or Sign up to answer