With remote and home working set to continue in 2021 during the Covid-19 pandemic, Trello as a project management and team collaboration tool has become one of the best and cheapest (Enterprise, Business Class, and Free, forever) solutions for the task management system.

It is a project management software that enables organizing a project into boards. Basically, it is the digital version of good old sticky notes. In addition, it can be easily customized and used instead of CRM software for businesses with simpler sales processes.

The best way to manage tasks with ease and accelerate everyday operations is to automate the process completely. The automation eases tracking errors which enables opening Trello board cards with to-do tasks without human interaction. This is very useful, as it provides detailed card information about created errors and enables a prompt reaction of the team.

This solution is based on automatically creating a Trello card in case of an error in a MuleSoft application.

MuleSoft provides the most widely used integration platform to connect any application, data service, or an API, across the cloud and on-premise continuum.

To use the MuleSoft Trello Connector, you should search for it in Exchange and then add the Trello Connector – Mule 4 dependency (Check Figure 1).

Figure 1: Add Dependencies to Project

Base Uri, key and token parameters are needed for the configuration. (Check Figure 2). For more details about how to get the Trello key and token please check the following link:

https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/

Figure 2: Trello Connector Config

To demonstrate the card creation in Trello, a simple Mule flow is created (Check Figure 3), which will fail processing the Transform Message component due to the “Cannot coerce String (invalid date) to Date” error. The message will be sent to the Error-Handler where On Error Propagate is configured to catch all types of errors (Check Figure 4).

Figure 3: MuleSoft flow

In order to prevent card duplication in Trello, an additional logic should be applied, which makes a call to retrieve all cards from a specific board. This is accomplished using the Get Boards Cards By Id Board Mulesoft connector (Figure 4).

Figure 4: Error-Handler

In the general part of the Get Boards Cards By Id Board connector, it is specified to return all the cards that are created in the last two days, with a maximum limit of 100 cards. In the field part, a list that consists of fields that should be received as part of the response is set.

According to the error.detailedDescription generated from the Mule application’s error handler and IdList field from the Trello response, we can check if a ticket with the same error description exists in the TODO, Doing or Done section.

Figure 5: Trello board

The Choice router is using the below dataweave script (Check Figure 6), to prevent duplicate card creation by checking if the ticket with the same description is already created in TODO or Doing stage of the board. If the ticket exists in the board, the choice component will route the message to the upper path that will simply log “Card is already created”.

If the message is sent to the Default route, the MuleSoft Add Cards connector will create a new Trello card. The bellow JSON Object (Check Figure 7) contains all available fields that can be sent as a Content parameter in the Add Cards connector.

%dw 2.0
output appilcation/java
---
using (idList = payload[?($.desc contains error.detailedDescription)].idList default [])
((idList contains p("trello.idList.TODO")) or (idList contains p("trello.idList.Doing")))

Figure 6: DataWeave script

%dw 2.0
output application/json
---
{
	"name"           : "APP: " ++ p('app.name') ++ " / ENV: " ++ p('env') ++ 		                   " / ERROR: " ++ error.errorType.asString,
	"desc"           : error.detailedDescription,
	"pos"            : if (p('env') == "prod") "top" else "bottom",
	"due"            : ( now() + |P2D| ) as Date {format: "yyyy-MM-dd"},
	"dueComplete"    : null,
	"idList"         : p("trello.idList.TODO"),
	"idMembers"      : p("trello.idMemberName"),
	"idLabels"       : null,
	"urlSource"      : null,
	"fileSource"     : null,
	"idCardSource"   : null,
	"keepFromSource" : null,
	"address"        : null,
	"locationName"   : null,
	"coordinates"    : null	
} filterObject $ != null

Figure 7: Content JSON Object

The main point of MuleSoft and Trello integration is to reduce the time needed to act upon a particular ticket being created when an application error occurs. The errors which require attention and need placement on a Trello board for further action, are highly configurable and adjustable based on a specific business need. This way, the overall client experience is improved by enabling the teams to focus on the card content, rather than card creation, which ultimately saves time and reduces cost.

Author

Contact us:

    I have read and accept ⋮IWConnect's Privacy Policy - Terms & Conditions