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

Hi, Our team is trying to build a custom plugin for Jira Datacenter to make custom fields mandatory.

Preethihr September 29, 2021

Can anyone help me to find any classes or methods in java to update field configuration by setting custom field as required.

I have found following method but I am not able to implement updateFieldLayoutItem method.

public void makeRequired(FieldLayoutItem fieldLayoutItem){  if (!getFieldManager().isRequirableField(fieldLayoutItem.getOrderableField()))  {    throw new IllegalArgumentException("Trying to require a field that is not requireable.");  }  // When requiring a field make it not hidden  final FieldLayoutItem modified = new FieldLayoutItemImpl.Builder(fieldLayoutItem)      .setHidden(false)      .setRequired(true)      .build();  updateFieldLayoutItem(fieldLayoutItem, modified);}

 

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Daniel Ebers
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.
July 31, 2022

A good point to start could be the documentation for Jira Sever (aimed to developers) which you can find here: https://docs.atlassian.com/software/jira/docs/api/8.22.6/
Please also find the start page which could be of further help:
https://developer.atlassian.com/server/

Please note that there are finally some Apps which probably cater the need. So it might make sense to have a look into Atlassian Marketplace in case you do not want to create the code from scratch by yourself.

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events