Adding Additional Fields to the 'associated Jira Issues' Visualforce page in Salesforce
Purpose
Additional Jira fields can be displayed in the "Associated Jira issues" Visualforce page in Salesforce.
On this page, we'll add "Affects Version/s" and "Fix Version/s" as in the screenshot below:
Answer
Prerequisite:
Then, you may add Fix Version/s and Affects Version/s by adding the following code snippets to:
JIRAFetchIssuesController Class:
public List<String> affected_versions { get; } public List<String> fix_versions { get; }
Jira Issues Visualforce page:
<!-- Issue affected versions column --> <apex:column headerValue="Affected Versions" value="{!issue.affected_versions}" /> <!-- Issue fix versions column --> <apex:column headerValue="Fix Versions" value="{!issue.fix_versions}" />
To add other Jira fields, make sure to use the correct field type in the JIRAFetchIssuesController Class
public List<String> fix_versions { get; }
To add other custom fields, make sure to use the correct field name in the JIRAFetchIssuesController Class and Visualforce page.
public String customfield_<id> { get; }
Note: the fields type is important to be set correctly, in this case customfield_<id> is String.
<!-- Issue custom field column -->
<apex:column headerValue="Custom Field" value="{!issue.customfield_<id>}" />