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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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

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
Community showcase
Published in Jira Service Management

Security Advisory for Jira Service Management

On October 20, 2021, Atlassian published a security advisory for Jira Service Management. The full advisory is available at this link.  We've seen a number of questions already asking for...

319 views 1 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you