Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6664861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:39:39+00:00 2026-05-26T02:39:39+00:00

I am trying to access a String array which i have created in my

  • 0

I am trying to access a String array which i have created in my Java class.
The string array is stored in a Map with the name ‘notSelected’ using the same key.

I also have a single String object called ‘testString’ stored in the same Map which i can easily access and display using:

$testString

However how do i go about accessing the String array object (notSelected) from the Map inside the velocity template object?

I have tried:

$notSelected.get(0)
$notSelected[0]
$notSelected.[0]
${notSelected}.get(0)

The last three seem to return the reference value of the memory location of the String array object but i still can’t access the values inside the array.

Any help is gladly appreciated. Thanks

Here is the java code:

public Map<String, Object> getVelocityParameters
        (final Issue issue, final CustomField field, final FieldLayoutItem fieldLayoutItem) {
    final Map<String, Object> map = super.getVelocityParameters(issue, field, fieldLayoutItem);
    String[] notSelected = {"foo", "bar", "baz"};
    map.put("notSelected", notSelected);

    String[] selected = {"foo", "bar", "baz"};
    map.put("selected", selected);

    //this code works and i can access $testString in the velocity template
    String testString = "Test Worked";
    map.put("testString", testString);

    return map;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:39:39+00:00Added an answer on May 26, 2026 at 2:39 am

    JIRA uses an older version of Velocity that does not support array index notation for accessing arrays. Instead, use a List and .get(n) notation:

    List foo = new ArrayList() {{ add("hi"); add("there"); }};
    
    $foo.get(0)
    $foo.get(1)
    

    And remember, little tidbits of info like the environment you’re operating in can make a huge difference (and when someone asks a question, there may be a reason for asking it 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I'm trying to access a WCF service which returns a JSON Array using
I have the following code which fetches a string from an array of strings
I have an array of objects which all derive from the class BaseStudent. BaseStudent**studentlist
I'm trying to access the resources of a derived abstract class (from PhoneApplicationPage) in
I'm trying to access the original command line argument string in Ruby (ie -
I have a database manager which successfully loads a string from my sqlite database,
In C++, I have an Object class, from which a number of other classes
I have an array of strings which i am already showing in my uitableview.
I have create to String array one is word another is sentence. <resources> <string-array
I am trying to store an array in localStorage (HTML5) which needs to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.