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 8890085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:25:09+00:00 2026-06-14T22:25:09+00:00

I am working on a Jira project and I am returning a data from

  • 0

I am working on a Jira project and I am returning a data from API query. The data is json_encode format.

I am having problem with access an array inside an array.

Here’s the json_encode data that I am working.

{
   "expand":"names,schema",
   "startAt":0,
   "maxResults":50,
   "total":1,
   "issues":[
      {
         "expand":"editmeta,renderedFields,transitions,changelog,operations",
         "id":"190579",
         "self":"http://jira.localhost.com/rest/api/2/issue/190579",
         "key":"JIRA-1234",
         "fields":{
            "summary":"Testing Jira ticket only",
            "progress":{
               "progress":0,
               "total":0
            },
            "issuetype":{
               "self":"http://jira.localhost.com/rest/api/2/issuetype/28",
               "id":"28",
               "description":"Short task independent from any project",
               "iconUrl":"http://jira.localhost.com/images/icons/ico_story.png",
               "name":"Ticket",
               "subtask":false
            },
            "timespent":null,
            "reporter":{
               "self":"http://jira.localhost.com/rest/api/2/user?username=username",
               "name":"username",
               "emailAddress":"username@localhost.com",
               "avatarUrls":{
                  "16x16":"http://jira.localhost.com/secure/useravatar?size=small&avatarId=10302",
                  "48x48":"http://jira.localhost.com/secure/useravatar?avatarId=10302"
               },
               "displayName":"User Name",
               "active":true
            },
            "customfield_10430":null,
            "customfield_10490":null,
            "created":"2012-11-26T00:32:26.000-0800",
            "updated":"2012-11-26T00:48:19.000-0800",
            "description":"test description",
            "priority":{
               "self":"http://jira.localhost.com/rest/api/2/priority/6",
               "iconUrl":"http://jira.localhost.com/images/icons/priority_major.gif",
               "name":"Normal",
               "id":"6"
            },
            "issuelinks":[

            ],
            "customfield_10471":null,
            "customfield_11054":[
               "server1,",
               "server2,",
               "server3,",
               "server4",
               "server5,",
               "server6,",
               "server7,",
               "server8,",
               "server9,",
               "server10,",
               "server11,",
               "server12,",
               "server13,"
            ],
            "subtasks":[

            ],
            "status":{
               "self":"http://jira.localhost.com/rest/api/2/status/1",
               "description":"The issue is open and ready for the assignee to start work on it.",
               "iconUrl":"http://jira.localhost.com/images/icons/status_open.gif",
               "name":"Open",
               "id":"1"
            },
            "customfield_10621":null,
            "workratio":-1,
            "customfield_10530":{
               "self":"http://jira.localhost.com/rest/api/2/customFieldOption/10694",
               "value":"S2",
               "id":"10694"
            },
            "customfield_11052":[
               "user.name:1",
               "username:1"
            ],
            "project":{
               "self":"http://jira.localhost.com/rest/api/2/project/JIRA",
               "id":"10190",
               "key":"JIRA",
               "name":"JIRA Tickets",
               "avatarUrls":{
                  "16x16":"http://jira.localhost.com/secure/projectavatar?size=small&pid=10190&avatarId=10011",
                  "48x48":"http://jira.localhost.com/secure/projectavatar?pid=10190&avatarId=10011"
               }
            },
            "customfield_10480":{
               "self":"http://jira.localhost.com/rest/api/2/customFieldOption/10613",
               "value":"QT - Manual",
               "id":"10613"
            },
            "customfield_10420":null,
            "customfield_10054":null,
            "customfield_10053":null,
            "customfield_10051":null,
            "customfield_10630":null,
            "aggregateprogress":{
               "progress":0,
               "total":0
            },
            "timeoriginalestimate":null,
            "customfield_10584":null,
            "customfield_10585":null,
            "customfield_10582":{
               "self":"http://jira.localhost.com/rest/api/2/customFieldOption/10934",
               "value":"Namesd",
               "id":"10934"
            },
            "customfield_10580":{
               "self":"http://jira.localhost.com/rest/api/2/customFieldOption/10808",
               "value":"Names",
               "id":"10808"
            },
            "customfield_10581":{
               "self":"http://jira.localhost.com/rest/api/2/customFieldOption/10913",
               "value":"Name",
               "id":"10913"
            },
            "votes":{
               "self":"http://jira.localhost.com/rest/api/2/issue/JIRA-1234/votes",
               "votes":0,
               "hasVoted":false
            },
            "fixVersions":[

            ],
            "resolution":null,
            "resolutiondate":null,
            "aggregatetimeoriginalestimate":null,
            "customfield_10125":null,
            "duedate":null,
            "watches":{
               "self":"http://jira.localhost.com/rest/api/2/issue/JIRA-1234/watchers",
               "watchCount":1,
               "isWatching":false
            },
            "customfield_10375":null,
            "customfield_10750":"<p>testing only</p>",
            "customfield_10651":"112965",
            "customfield_10374":null,
            "customfield_10650":"128836",
            "customfield_10652":null,
            "customfield_10370":null,
            "assignee":{
               "self":"http://jira.localhost.com/rest/api/2/user?username=johnsmith",
               "name":"johnsmith",
               "emailAddress":"johnsmith@localhost.com",
               "avatarUrls":{
                  "16x16":"http://jira.localhost.com/secure/useravatar?size=small&avatarId=10302",
                  "48x48":"http://jira.localhost.com/secure/useravatar?avatarId=10302"
               },
               "displayName":"John Smith",
               "active":true
            },
            "customfield_10590":null,
            "customfield_10500":{
               "self":"http://jira.localhost.com/rest/api/2/customFieldOption/10630",
               "value":"1",
               "id":"10630"
            },
            "aggregatetimeestimate":null,
            "customfield_10170":null,
            "timeestimate":null,
            "customfield_10440":null,
            "aggregatetimespent":null
         }
      }
   ]
}

Here’s my snippet PHP code to access the record and print.

foreach ($json_output->issues as $issues) {

    echo "{$issues->key}";
    echo "{$issues->fields->summary}";
    echo "{$issues->fields->created}";
    echo "{$issues->fields->reporter->name}";

}

Now when I want to access the customfield_11054 so I could print the list of servers

server1, server2, server3, server4, server5, server6, server7, server8, server9, server10,
server11, server12, server13

so I add this

foreach ($json_output->issues as $issues) {

    echo "{$issues->key}";
    echo "{$issues->fields->summary}";
    echo "{$issues->fields->created}";
    echo "{$issues->fields->reporter->name}";
    echo "{$issues->fields->customfield_11054}";    
}

But I am getting result as an array.

  • 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-06-14T22:25:11+00:00Added an answer on June 14, 2026 at 10:25 pm

    print_r($issues->fields->customfield_11054);

    It IS an array, which is why it says it’s an array. If you wanted to get the values you’d have to wrap another foreach there:

    foreach ($json_output->issues as $issues) {
    
        echo $issues->key;
        echo $issues->fields->summary;
        echo $issues->fields->created;
        echo $issues->fields->reporter->name;
        foreach($issues->fields->customfield_11054 as $customField)
        {
            echo $customField;
        }
    }
    

    Also, as a side note you don’t need to put your variables in “{}” to print them out. They’re strings, so just using echo $variable; will work just fine (as I’ve put in the above snippit).

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

Sidebar

Related Questions

I'm working on a tool in C# that interfaces the JIRA SOAP API. I
Working on calling a C function from my asm project. I'm trying to push
I am working with the Jira SOAP API, and I have managed to read
i am working with php and jira soap api and i wanted to know,
Having a wierd problem in JIRA at the moment. When Im on the Edit
I'm working on a JIRA implementation and need to make use of the API.
Working with an undisclosed API, I found a function that can set the number
Working on the problems on Project Euler to try to learn Clojure. I'm on
Working with MS Access for the first time and coming across a few problems
Working on game where plates will be falling from top to bottom. Some plates

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.