Send http request body json test failed

hello,

i am using a “send http request” the body json look like:

{
  "title": "{{trigger['answers']['478ead82']['textAnswers']['answers'][0]['value']}} {{trigger['answers']['676e830c']['textAnswers']['answers'][0]['value']}} {{trigger['answers']['5110af94']['textAnswers']['answers'][0]['value']}} {{trigger['answers']['3211595d']['textAnswers']['answers'][0]['value']}}",
  "labels": [
    "workflow::ready to start",
    "type::on-boarding",
    "help desk request"
  ]
}

the ticket in git lab is created sucessfully:

but i still receiving few errors on testing:


"\"{\\\"response\\\":{\\\"status\\\":500},\\\"request\\\":{\\\"body\\\":{\\\"title\\\":\\\"ONBOARDING TEST_project FrancescoTEST veroliTEST\\\",\\\"labels\\\":[\\\"workflow::ready to start\\\",\\\"type::on-boarding\\\",\\\"help desk request\\\"]}}}\""

can you please helps to format the json body correctly?

thanks a lot

Francesco
IT SUpport

Hi @Francesco_Veroli

Can you send the API reference you are using for this particular request?

I think your part of labels should be structured the following way

Labels: {

“Key”:“value”,
“Key”:“value”,
“Key”:“value”
}

HI @Bram i’ve followed your structure here:

{
  "title":"{{trigger['answers']['478ead82']['textAnswers']['answers'][0]['value']}}%20{{trigger['answers']['676e830c']['textAnswers']['answers'][0]['value']}}%20{{trigger['answers']['5110af94']['textAnswers']['answers'][0]['value']}}%20{{trigger['answers']['3211595d']['textAnswers']['answers'][0]['value']}}",
  "labels":[
    "workflow":"ready to start",
    "group":"desktop support",
    "type":"on-boarding"
  ]
}

but unfortunatelly no ticket has been created this time, here the output:

"{\"response\":{\"status\":400,\"body\":{\"error\":\"title is missing\"}},\"request\":{\"body\":\"{\\n  \\\"title\\\":\\\"ONBOARDING%20TEST_project%20FrancescoTEST%20veroliTEST\\\",\\n  \\\"labels\\\":[\\n    \\\"workflow\\\":\\\"ready to start\\\",\\n    \\\"group\\\":\\\"desktop support\\\",\\n    \\\"type\\\":\\\"on-boarding\\\"\\n  ]\\n}\"}}"

Hi @Francesco_Veroli,

Please take a good look at the output, it mentions there is no title, please for testing purposes use some hard codes data instead of a reference. like “Ticket_title_A” for example.

Please duplicatie the Piece first before making the changes.

Kr Bram

@Bram

hardcoded as you mentioned but still the same error, undestandable… can you please help?

{
  "title": "Ticket_title_A",
  "labels": [
    "workflow":"ready to start",
    "group":"desktop support",
    "type":"on-boarding"
  ]
}

output:

"\"{\\\"response\\\":{\\\"status\\\":400,\\\"body\\\":{\\\"error\\\":\\\"title is missing\\\"}},\\\"request\\\":{\\\"body\\\":\\\"{\\\\n  \\\\\\\"title\\\\\\\": \\\\\\\"Ticket_title_A\\\\\\\",\\\\n  \\\\\\\"labels\\\\\\\": [\\\\n    \\\\\\\"workflow\\\\\\\":\\\\\\\"ready to start\\\\\\\",\\\\n    \\\\\\\"group\\\\\\\":\\\\\\\"desktop support\\\\\\\",\\\\n    \\\\\\\"type\\\\\\\":\\\\\\\"on-boarding\\\\\\\"\\\\n  ]\\\\n}\\\"}}\""

mmm cna you share the API Docs you are refering to?

Hey @Bram can you please explain? what api docs you refering?

Please see this example of Flowlu:

This kind of documentation should help in checking if the prompt is correct. i am looking for something similar for what you are trying to connect with. The reason for this is because apparently the Application is not seeing “title” and title

https://www.flowlu.com/api/

thanks @Bram for clarifiy.

REST API | GitLab here you have the documentation

fixed with this json format:

{
  "title": "{{trigger['answers']['478ead82']['textAnswers']['answers'][0]['value']}} | {{trigger['answers']['676e830c']['textAnswers']['answers'][0]['value']}} | {{trigger['answers']['5110af94']['textAnswers']['answers'][0]['value']}} | {{trigger['answers']['3211595d']['textAnswers']['answers'][0]['value']}}",
  "description": "hello world",
  "labels": [
    "help desk request",
    "workflow::ready to start",
    "group:desktop support"
  ]
}

logs:

{
  "status": 201,
  "headers": {
    "date": "Wed, 20 Nov 2024 12:38:11 GMT",
    "content-type": "application/json",
    "content-length": "1860",
    "connection": "close",
    "cache-control": "max-age=0, private, must-revalidate",
    "content-security-policy": "default-src 'none'",
    "etag": "W/\"784bb35c3d7986041b87c14b452ad947\"",
    "vary": "Origin",
    "x-content-type-options": "nosniff",
    "x-frame-options": "SAMEORIGIN",
    "x-gitlab-meta": "{\"correlation_id\":\"4d4535453b8610271235c63696b6aca9\",\"version\":\"1\"}",
    "x-request-id": "4d4535453b8610271235c63696b6aca9",
    "x-runtime": "0.667653",
    "strict-transport-security": "max-age=31536000",
    "referrer-policy": "strict-origin-when-cross-origin",
    "gitlab-lb": "haproxy-main-50-lb-gprd",
    "gitlab-sv": "gke-cny-api",
    "cf-cache-status": "DYNAMIC",
    "report-to": "{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=cwSF2Ez%2BmsNrDxZFGGCp08eAXkYLqp5rlVcJuts40DNUK4ceFGhwV8sPT91lHWVbmFPdzq0UGRkufmFlOkN4TK9%2FpjVQNAor2Jk5WSEdQ2VcmbXhyZ2MWfJiO%2FA%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}",
    "nel": "{\"success_fraction\":0.01,\"report_to\":\"cf-nel\",\"max_age\":604800}",
    "set-cookie": "_cfuvid=QVe.r3waEUOkKFqbva42RZ3VjtU5RBlpQoQ0z1nWEqE-1732106291679-0.0.1.1-604800000; path=/; domain=.gitlab.com; HttpOnly; Secure; SameSite=None",
    "server": "cloudflare",
    "cf-ray": "8e587ede1bf8955b-DUB"
  },
  "body": {
    "id": 157671963,
    "iid": 2357,
    "project_id": 22134582,
    "title": "ONBOARDING | TEST_project | FrancescoTEST | veroliTEST",
    "description": "hello world",
    "state": "opened",
    "created_at": "2024-11-20T12:38:11.374Z",
    "updated_at": "2024-11-20T12:38:11.374Z",
    "closed_at": null,
    "closed_by": null,
    "labels": [
      "group:desktop support",
      "help desk request",
      "workflow::ready to start"
    ],
    "milestone": null,
    "assignees": [],
    "author": {
      "id": 23474261,
      "username": "project_22134582_bot_95f55965cfbeb98b9a6087793431dc54",
      "name": "ActivepeciesTest",
      "state": "active",
      "locked": false,
      "avatar_url": "https://secure.gravatar.com/avatar/7f2aa3b3d13ef49e2768555e6d58aba649af0c766e1766cc0ffff83306d035c7?s=80&d=identicon",
      "web_url": "https://gitlab.com/project_22134582_bot_95f55965cfbeb98b9a6087793431dc54"
    },
    "type": "ISSUE",
    "assignee": null,
    "user_notes_count": 0,
    "merge_requests_count": 0,
    "upvotes": 0,
    "downvotes": 0,
    "due_date": null,
    "confidential": false,
    "discussion_locked": null,
    "issue_type": "issue",
    "web_url": "https://gitlab.com/orcastudios/helpdesk/-/issues/2357",
    "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
    },
    "task_completion_status": {
      "count": 0,
      "completed_count": 0
    },
    "weight": null,
    "blocking_issues_count": 0,
    "has_tasks": true,
    "task_status": "0 of 0 checklist items completed",
    "_links": {
      "self": "https://gitlab.com/api/v4/projects/22134582/issues/2357",
      "notes": "https://gitlab.com/api/v4/projects/22134582/issues/2357/notes",
      "award_emoji": "https://gitlab.com/api/v4/projects/22134582/issues/2357/award_emoji",
      "project": "https://gitlab.com/api/v4/projects/22134582",
      "closed_as_duplicate_of": null
    },
    "references": {
      "short": "#2357",
      "relative": "#2357",
      "full": "orcastudios/helpdesk#2357"
    },
    "severity": "UNKNOWN",
    "subscribed": true,
    "moved_to_id": null,
    "imported": false,
    "imported_from": "none",
    "service_desk_reply_to": null,
    "epic_iid": null,
    "epic": null,
    "iteration": null
  }
}
1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.