Missed Team ’24? Catch up on announcements here.

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

Automação com JSON para lista de CNPJs de clientes

Leonardo Solano May 10, 2023

Olá, 

Sou novo por aqui e gostaria de uma ajuda para criar automação dentro do JIRA com JSON.

Preciso que: quando campo do cliente for alterado/inclui o valor do cliente, seja disparado a automação e preencha o CNPJ conforme o nome do cliente. É possível?

{
"field": "customfield_XX1",
"value": "Cliente1"
,
"customfield_XX2": [{
"set": "Cnpj1"
}]
}

obrigado!

2 answers

0 votes
Leonardo Solano May 23, 2023

Olá, @Trudy Claspill ! 

Customfield_xx1 é um campo de texto, onde insiro o nome dos meus clientes.
Customfield_xx2 é um campo de texto também, mas insiro o CNPJ dos clientes.

Por enquanto, cheguei até esse momento: 

{
"trigger": {
"issue_updated": {
"customfield": "Customfield_10004",
"is_not_empty": true
}
},
"condition": {
"condition": "none"
},
"actions": [
{
"action": "run_script",
"script_body": "let clientes = {\"Cliente1\": \CNPJ Cliente1"\", \"Cliente2\": \"Cliente CNPJ2\", \"Cliente C\": \"CNPJ C\"}; let cliente = issue.fields.Customfield_10004; if (clientes.hasOwnProperty(cliente)) { return { 'customfield_10284': [{ 'set': clientes[cliente] }] }; } else { return { 'customfield_10284': null }; }"
},
{
"update": {
"customfield_10284": [
"set": "{{scriptOutput}}"
]
}
}
]
}

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 19, 2023

Olá @Leonardo Solano ,

Bem-vindo à comunidade da Atlassian.

Que tipo de campo é customfield_XX1?

Que tipo de campo é customfield_XX2?

Você pode nos mostrar toda a regra de automação que você construiu?

 

 

===

Hello,

Welcome to the Atlassian community.

What type of field is customfield_XX1?

What type of field is customfield_XX2?

Can you please show us the entire automation rule you have constructed?

 

Automation with JSON for list of customer CNPJs

Hello,

I'm new here and would like some help creating automation within JIRA with JSON.

I need that: when the customer's field is changed/includes the customer's value, the automation is triggered and fill in the CNPJ according to the customer's name. It's possible?

Leonardo Solano May 23, 2023

Olá, @Trudy Claspill ! 

Customfield_xx1 é um campo de texto, onde insiro o nome dos meus clientes. (Customfield_10004)

Customfield_xx2 é um campo de texto também, mas insiro o CNPJ dos clientes.
(Customfield_10284)

Por enquanto, cheguei até esse momento: 

{
"trigger": {
"issue_updated": {
"customfield": "Customfield_10004",
"is_not_empty": true
}
},
"condition": {
"condition": "none"
},
"actions": [
{
"action": "run_script",
"script_body": "let clientes = {\"Cliente1\": \CNPJ Cliente1"\", \"Cliente2\": \"Cliente CNPJ2\", \"Cliente C\": \"CNPJ C\"}; let cliente = issue.fields.Customfield_10004; if (clientes.hasOwnProperty(cliente)) { return { 'customfield_10284': [{ 'set': clientes[cliente] }] }; } else { return { 'customfield_10284': null }; }"
},
{
"update": {
"customfield_10284": [
"set": "{{scriptOutput}}"
]
}
}
]
}

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 24, 2023

Olá Leonardo,

Não vi uma ação para executar script na interface do usuário. Como você conseguiu adicionar essa ação à sua regra?

O código que você apresentou foi gerado pela exportação de uma regra de automação por meio da interface do usuário? Em caso afirmativo, você pode nos mostrar uma imagem da tela da regra conforme ela é mostrada na IU?

 

---

Hello Leonardo,

I have not seen an Action for Run Script in the UI. How were you able to add that action to your rule? 

Was the code you presented generated by exporting an automation rule through the UI? If so, can you show us a screen image of the rule as it is shown in the UI?

Customfield_xx1 is a text field, where I enter the name of my customers. (Customfield_10004)

Customfield_xx2 is a text field too, but I insert the CNPJ of the clients.
(Customfield_10284)

So far, I've come to this point:

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events