Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

163
Visualizações
How to format Array value in slack json string

I want to send slack notification for my test result.

here is my Array

TestCase Name : [Test 1,Test 2,Test 3r]

TestCase Status : [true,false,false]

How do i create this string using javascript.

Here is my JsonString i Want using javascript



{
    "blocks": [
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "WebDriverIO Automation Status .\n\n *Following are details:*"
            }
        },
        {
            "type": "divider"
        },
        {
            "type": "context",
            "elements": [
                {
                    "type": "mrkdwn",
                    "text": "Test 1"
                },
                {
                    "type": "mrkdwn",
                    "text": " :negative_squared_cross_mark: "
                }
            ]
        },
        {
            "type": "context",
            "elements": [
                {
                    "type": "mrkdwn",
                    "text": "Test 2"
                },
                {
                    "type": "mrkdwn",
                    "text": " :x: "
                }
            ]
        },
        {
            "type": "context",
            "elements": [
                {
                    "type": "mrkdwn",
                    "text": "Test 3r"
                },
                {
                    "type": "mrkdwn",
                    "text": " :x: "
                }
            ]
        }
    ]
}

Slack Webhook:

axios.post(
            "hook url",
            {
                text: `${asJSON}`,
            }
        );
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda