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,556,225
Community Members
 
Community Events
184
Community Groups

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

Edited

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

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?

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