Missed Team ’24? Catch up on announcements here.

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

How do I include a custom field in peopleblock.vm?

Paul Mata December 17, 2020

I have custom scripted fields that I use to display additional customer information that I collect using a metadata plugin. This works well to allow me to have additional information for the support technicians to identify the customer and the level of support (which ties into our SLAs), but it is displayed in the typical area where custom fields are displayed and it seems disjointed from the customer information.

 

I would like to display this information in the people block on the right side of the screen, and through some investigation it appears that this should be possible by editing the peopleblock.vm which is contained in the jira-view-issue-plugin-8.7.1.jar file.

 

I have been able to successfully extract the files from the command line and locate the file that I need to edit, but I'm not sure how to edit the files to display the field I need. I tried the following code, but when I restart Jira (yes, I'm using a test instance, not production), I get a blank page when I view an issue (see image following the code).

 

#* @vtlvariable name="field" type="com.atlassian.jira.plugin.viewissue.web.CustomFieldModel" *#
#* @vtlvariable name="peopleComponent" type="com.atlassian.jira.plugin.viewissue.PeopleBlockContextProvider" *#
#parse("/viewissue/fields/fieldMacros.vm")
#enable_html_escaping()
<div class="item-details people-details" id="peopledetails">
#if ($assigneeVisible)
#systemField("assignee")
#end
#if ($reporterVisible)
#systemField("reporter")
#customField("customfield_11500") <-- this is the line I added
#end
#if ($archiverVisible)
#systemField("archiver")
#end
#foreach($field in $userCustomFields)
#peopleCustomField($field)
#end
</div>
#if ($votingEnabled || $watchingEnabled)
<div class="item-details">
#systemField("votes")
#systemField("watches")
</div>
#end

blank_screen.png

Would appreciate any ideas to help solve this problem. 

1 answer

1 accepted

0 votes
Answer accepted
Paul Mata February 4, 2021

In case anyone else comes across this question and wants to know what I did to resolve my issue, I found out that the plugin I was already using (Metadata for Jira) allows you to add a web block to your project issue view (as well as a lot of other great features). Now I can display my customer information all together in the column on the right of the page.

customer-details.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events