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

2 answers

1 accepted

0 votes
Answer accepted
Geert Truyen
Contributor
August 20, 2012

I raised a ticket after which the support department did something in my onDemand environment after which the original estimates nicely appear.

Thanks guys !

1 vote
Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 16, 2012

According to this documentation, you can add the column "timeoriginalestimate" from IssueFieldConstants into jira.table.cols.subtasks property

Geert Truyen
Contributor
August 16, 2012

Kah,

Does this apply to onDemand as well ???

TX

Geert Truyen
Contributor
August 16, 2012

It does not!

Please refer to your documentation: https://confluence.atlassian.com/display/JIRA/Advanced+JIRA+Configuration

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 16, 2012

It should be working. If its not, please report it to the support team https://support.atlassian.com/browse/JST

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 16, 2012

ira.table.cols.subtasks property is on of the property that can be edited in JIRA Administration > General Configuration > Advanced Settings. Those that can't be edited will require the user to create the property file.

Geert Truyen
Contributor
August 16, 2012

In onDemand there is no path JIRA Administration > General Configuration > Advanced Settings.

... Subsequently I don't have a clue what you are refering to.

Foong
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 16, 2012

Sorry for my mistake. I have just confirmed with the onDemand team that Advanced setting page is restricted to our support team only. You will need to raise a ticket to change the setting https://support.atlassian.com/browse/JST

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events