Forums

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

How can we get project specific custom field list in our plugin.

Shivya2708 June 4, 2021

I am new to jira plugin development, Can anyone please provide me a code for getting all the project specific custom fields in my plugin.

 

I have tried using this code but it is not working.

Java FIle : 

private CustomFieldManager CFM = ComponentAccessor.getCustomFieldManager();


public Map createVelocityParams1(BrowseContext ctx) {

Map params = super.createVelocityParams(ctx);
List<CustomField> customField = CFM.getCustomFieldObjects();
params.put("fields",customField);
return params;
}

Velocity File:

<div class="module">
<div class="mod-content">
<table class="aui">
#foreach( $entry in $fields )
#foreach ($CustomField in $entry)
<tr> $CustomField </tr>
#end
#end
</table>
</div>
</div>

1 answer

0 votes
Nic Brough -Adaptavist-
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.
June 4, 2021

Could you explain "is not working"?

Is it spitting out what looks like rubbish?  Badly formatted but technically correct?  Nothing at all?  All of those are possibilities I can see might be happening from your code, but I can't hope that an essay on all of them would stand any chance of solving it.  Better to see the actual problem than run off down totally the wrong route.

Suggest an answer

Log in or Sign up to answer