23 Mär 2015
Accessing Field Configurations in JIRA for changing field description

Accessing Field Configurations in JIRA for changing field description

Field configuration defines behavior of all standart (system) fields and custom fields available in JIRA installation.

Each field in field configuration has:

  • description that appears under the field when an issue is edited,
  • visibility rule of the field,
  • option whether the field is required or optional,
  • renderer for text fields.

Field configurations allow to make configurations of fields for projects to have different behaviour in these projects.

Sometimes a field should have the same behaviour in all projects, but going through all of them manually is uncomfortable process. So it can be automated by using JIRA API. The example is changing description of a field for all projects.

 

Task: change the description in a custom field.

Solution: To change the description of the custom field we need to get a custom field object, change the description and update this object.

CustomFieldManager fieldManager = ComponentAccessor.getCustomFieldManager();
CustomField customField = fieldManager.getCustomFieldObjectByName("My Field");
customField.setDescription("New description");
fieldManager.updateCustomField(customField);

But this works only if the field is not linked to the custom Field Configurations.

To change the description of a custom field in Default Field Configuration:

EditableDefaultFieldLayout defaultFieldConfiguration = 
ComponentAccessor.getFieldLayoutManager().getEditableDefaultFieldLayout();

List<FieldLayoutItem> fields = defaultFieldConfiguration.getFieldLayoutItems();

for (FieldLayoutItem field : fields) {
if (item.getOrderableField().getId().equals(customField.getId())) {
defaultFieldConfiguration.setDescription(field, "New description");
}
}

ComponentAccessor.getFieldLayoutManager().storeEditableDefaultFieldLayout(layout);

To change the description of a custom field in all custom Field Configurations:

List<EditableFieldLayout> fieldConfigurations = 
ComponentAccessor.getFieldLayoutManager().getEditableFieldLayouts();

for (EditableFieldLayout fieldConfiguration : fieldConfigurations) {
List<FieldLayoutItem> fields = fieldConfiguration.getFieldLayoutItems();

for (FieldLayoutItem field : fields) {
if (field .getOrderableField().getId().equals(customField .getId())) {
fieldConfiguration.setDescription(field, "New description");
}
}

ComponentAccessor.getFieldLayoutManager().storeEditableFieldLayout(fieldConfiguration);
}

In this way fields can be managed.

Ähnliche Posts


  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza -1 OR 2+335-335-1=0+0+0+1 --
    555

  • 28-06-2022 ZMskyuza -1 OR 2+970-970-1=0+0+0+1
    555

  • 28-06-2022 ZMskyuza -1' OR 2+97-97-1=0+0+0+1 --
    555

  • 28-06-2022 ZMskyuza -1' OR 2+445-445-1=0+0+0+1 or 'GDzfnvli'='
    555

  • 28-06-2022 ZMskyuza -1" OR 2+915-915-1=0+0+0+1 --
    555

  • 28-06-2022 ZMskyuza if(now()=sysdate(),sleep(15),0)
    555

  • 28-06-2022 ZMskyuza 0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
    555

  • 28-06-2022 ZMskyuza 0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z
    555

  • 28-06-2022 ZMskyuza (select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/
    555

  • 28-06-2022 ZMskyuza -1; waitfor delay '0:0:15' --
    555

  • 28-06-2022 ZMskyuza -1); waitfor delay '0:0:15' --
    555

  • 28-06-2022 ZMskyuza 1 waitfor delay '0:0:15' --
    555

  • 28-06-2022 ZMskyuza Bn7rtxfq'; waitfor delay '0:0:15' --
    555

  • 28-06-2022 ZMskyuza -5 OR 112=(SELECT 112 FROM PG_SLEEP(15))--
    555

  • 28-06-2022 ZMskyuza -5) OR 423=(SELECT 423 FROM PG_SLEEP(15))--
    555

  • 28-06-2022 ZMskyuza -1)) OR 471=(SELECT 471 FROM PG_SLEEP(15))--
    555

  • 28-06-2022 ZMskyuza QuA9UEqQ' OR 519=(SELECT 519 FROM PG_SLEEP(15))--
    555

  • 28-06-2022 ZMskyuza YAPc8oCb') OR 770=(SELECT 770 FROM PG_SLEEP(15))--
    555

  • 28-06-2022 ZMskyuza L22RGPzh')) OR 747=(SELECT 747 FROM PG_SLEEP(15))--
    555

  • 28-06-2022 ZMskyuza 1*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)
    555

  • 28-06-2022 ZMskyuza 1'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
    555

  • 28-06-2022 ZMskyuza 1'"
    555

  • 28-06-2022 ZMskyuza @@hjNUK
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    -1 OR 2+113-113-1=0+0+0+1 --

  • 28-06-2022 ZMskyuza 1
    -1 OR 2+785-785-1=0+0+0+1

  • 28-06-2022 ZMskyuza 1
    -1' OR 2+475-475-1=0+0+0+1 --

  • 28-06-2022 ZMskyuza 1
    -1' OR 2+148-148-1=0+0+0+1 or 'TMYZmVTg'='

  • 28-06-2022 ZMskyuza 1
    -1" OR 2+654-654-1=0+0+0+1 --

  • 28-06-2022 ZMskyuza 1
    if(now()=sysdate(),sleep(15),0)

  • 28-06-2022 ZMskyuza 1
    0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z

  • 28-06-2022 ZMskyuza 1
    0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z

  • 28-06-2022 ZMskyuza 1
    (select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/

  • 28-06-2022 ZMskyuza 1
    -1; waitfor delay '0:0:15' --

  • 28-06-2022 ZMskyuza 1
    -1); waitfor delay '0:0:15' --

  • 28-06-2022 ZMskyuza 1
    1 waitfor delay '0:0:15' --

  • 28-06-2022 ZMskyuza 1
    7X2lXV6A'; waitfor delay '0:0:15' --

  • 28-06-2022 ZMskyuza 1
    -5 OR 906=(SELECT 906 FROM PG_SLEEP(15))--

  • 28-06-2022 ZMskyuza 1
    -5) OR 727=(SELECT 727 FROM PG_SLEEP(15))--

  • 28-06-2022 ZMskyuza 1
    -1)) OR 658=(SELECT 658 FROM PG_SLEEP(15))--

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    CJN6bNUr' OR 845=(SELECT 845 FROM PG_SLEEP(15))--

  • 28-06-2022 ZMskyuza 1
    XMjfEL0o') OR 190=(SELECT 190 FROM PG_SLEEP(15))--

  • 28-06-2022 ZMskyuza 1
    hxyhY6kj')) OR 169=(SELECT 169 FROM PG_SLEEP(15))--

  • 28-06-2022 ZMskyuza 1
    555*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)

  • 28-06-2022 ZMskyuza 1
    555'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'

  • 28-06-2022 ZMskyuza 1
    1'"

  • 28-06-2022 ZMskyuza 1
    @@TAy4G

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 -1 OR 2+244-244-1=0+0+0+1 -- 1
    555

  • 28-06-2022 -1 OR 2+909-909-1=0+0+0+1 1
    555

  • 28-06-2022 -1' OR 2+933-933-1=0+0+0+1 -- 1
    555

  • 28-06-2022 -1' OR 2+537-537-1=0+0+0+1 or 'ANPlO5u9'=' 1
    555

  • 28-06-2022 -1" OR 2+296-296-1=0+0+0+1 -- 1
    555

  • 28-06-2022 if(now()=sysdate(),sleep(15),0) 1
    555

  • 28-06-2022 0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z 1
    555

  • 28-06-2022 0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z 1
    555

  • 28-06-2022 (select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/ 1
    555

  • 28-06-2022 1 waitfor delay '0:0:15' -- 1
    555

  • 28-06-2022 lUUp9Tvd'; waitfor delay '0:0:15' -- 1
    555

  • 28-06-2022 vUeeFJh9' OR 353=(SELECT 353 FROM PG_SLEEP(15))-- 1
    555

  • 28-06-2022 rzFfzTmC') OR 272=(SELECT 272 FROM PG_SLEEP(15))-- 1
    555

  • 28-06-2022 jPGoWbgU')) OR 950=(SELECT 950 FROM PG_SLEEP(15))-- 1
    555

  • 28-06-2022 ZMskyuza'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||' 1
    555

  • 28-06-2022 1'" 1
    555

  • 28-06-2022 @@ud1oS 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

  • 28-06-2022 ZMskyuza 1
    555

Favoriteneinträge

What it Takes to Get an e-Commerce Site Online

Getting an e-Commerce website online might sound like a huge undertaking,...

WebView Interactions with JavaScript

WebView displays web pages. But we are interested not only in web-content...

Google Maps API for Android

Google Maps is a very famous and helpful service, which firmly entrenched...

Unit Testing with RSpec

RSpec is an integral part of Test Drive Development (TDD) and its main id...

Client side JavaScript: Knockout in practice

When developing a web application that extensively works with user input ...

Accessing Field Configurations in JIRA for changing field description

Field configuration defines behavior of all standart (system) fields and ...

A Guide for Upgrading to Ruby on Rails 4.2.0

As you might have already heard, the latest stuff for upgrading rails was...