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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,948
Community Members
 
Community Events
184
Community Groups

{"error":"incident[components] is invalid"} (PHP)

Edited

I did more than 10 ways to put the incident connected with the component but no one works correctly .

 

Structured array:

$array = array();
foreach ($components as $component)
{
$array[$component['id']] = $components_status;
}
$postparams = array();
$postparams["incident[components]"] = json_encode($array);
foreach ($components as $component)

{
$cid = $component['id'];
$postparams["incident[components][$cid]"] = $components_status;
}

 

My output is similar to the API documentation but not work

Array
(
[incident[component_ids]] => [".....3j0qxc",".....38ds4m",".....h59d9"]
[incident[components]] => {".....j0qxc":"partial_outage",",,,,,,8ds4m":"partial_outage",".....7h59d9":"partial_outage"}
)

 

The incident always is created with no component associated, and I need make this relationship under statuspage.

 

I shared the function of my class here :

https://pastebin.com/TmyZHZbJ

 

Any idea?

 

2 answers

1 accepted

0 votes
Answer accepted

Finally I found a way, here the correct way to connect the incident with a component:

 

$this->param["incident[component_ids]"] = '["....k38ds4m"]';
$this->param["incident[components][.....k38ds4m]"] = self::COMPONENT_STATUS_PARTIAL_OUTAGE;

Did other tests and nothing...

Anyone can help me ???

{"error":"incident[components] is invalid"}
Array
(
[incident[name]] => Teste 14:39:26-9783
[incident[body]] => Em 14:39:26 foi registrado o erro 160 na rotina Objeto.Teste()
[incident[status]] => identified
[incident[impact_override]] => major
[incident[component_ids]] => [".......hf4pq","......7h59d9"]
[incident[components]] => {"......hf4pq":"partial_outage",".....7h59d9":"partial_outage"}
)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events