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

Jira Automation Email Signature Handling - Removal

Craig Otten
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 6, 2024

Overview

The following information is my approach on how I handled email signatures within my organization and how Jira processes them into tickets. One of the biggest complaints I've had from my users is how Jira handles email signatures especially those in email threads from replied or forwarded emails. When a user includes our email support distribution lists on a large email thread, the auto-created ticket would explode with all of the email signatures, and it makes the ticket hard to read. 

Jira today does a really good job of detecting and collapsing the primary signature, but it only does the signature of the user that sent the email that caused the ticket to get created. The signatures in the email thread get missed. The following setup is my approach to address this scenario.

This method also maintains the message headers within the email thread so your ticket will maintain who sent the response within the ticket as well, so you don't have to rely on the email signature for that. 

Here is an example ticket output from the setup below after the signatures were removed:

Screenshot 2024-08-06 110213.png


Signature Setup

Within our organization, we use an app within Outlook that normalizes and auto-applies signatures to all our users. We are currently using Code2 to accomplish this. This allows us to use a defined template, designed by our marketing team, for all users and then pass in the user specific variables (name, email, phone, etc) for the specific user while they are drafting their email. Controlling the signatures is simple HTML code for creating the template configured in the Code2 platform.

Because of our use of this signature app, I was able to encapsulate the primary and reply signature templates with unique text strings before and after the signature. I tried to make these strings appear to be part of the signature just in case our user's noticed them. For the purposes of this example, for the start of the signature I used 4 white dashes, "----", and at the end of the signature I used 4 white underscores, "____". I made the text for these white to try and hide them from the user so they wouldn't be tempted to remove them. 

Note: I got lucky with this because while the user is drafting the email, these 4 white characters don't actually appear in dark mode but they are there and after the user sends the email, they can then see them. This is the behavior I noticed on the new Outlook and Web Outlook. I'm not sure what happens on the old version of Outlook. 

Example image of signature (notice the top and bottom characters before/after the signature area): 

Screenshot 2024-08-06 104338_new.png

For the signature itself, that is all that was needed.


Jira Automation Setup

To setup the processing of the ticket to handle these signatures, I performed the following:

Please note: there is probably a cleaner way to set this up. Once I got it to work, I left it alone. I'm sure you can understand that feeling. 

Here is my process (screenshots below):

  1. When an issue is created in Jira, I first create a new variable called "descOne".
    1. For this variable, I re-work the description to remove everything after the first "{adf}" tag in the description code. This removes the primary signature that Jira autodetects.
    2. The smart value for this is as follows:
      {{issue.description.remove(issue.description.substringAfter("{adf}"))}}
  2. I then create another variable called "descTwo"
    1. For this variable, I then take the result of "descOne" and remove the remaining "{adf}" tag as one is left over from step 1. The smart value for this is as follows: 
    2. {{descOne.remove("{adf}")}}
  3. For the next step, I create another variable called "descThree"
    1. This variable will take the result of "descTwo" and use the find/replaceAll command to remove anything in "descTwo" that is between and including the 4 white "----" and 4 white "____" within the ticket. The smart value for this is as follows:
    2. {{descTwo.replaceAll("(?s)\\{color:#ffffff\\}----\\{color\\}.*?\\{color:#ffffff\\}____\\{color\\}", "")}}
      1. Note: Because I am using 4 white "----" and "____" to encapsulate the signatures, I am able to target remove not only the characters themselves but also the color of them too. I'm doing this to limit the risk of removing things not within the signature. 
  4. I then assign "descThree" as the issue's new description and should be all set.
    1. Depending on how you setup your signatures, you may need to change step 3 to target your configuration accordingly.

Screenshots below of the full process and example of our signature.

Variable 1: descOne setup

Screenshot 2024-08-06 104002.png

Variable 2: descTwo setup

Screenshot 2024-08-06 104113.png

Variable 3: descThree setup

Screenshot 2024-08-06 104159.png

Last step: Assign the result to desc

Screenshot 2024-08-06 104233.png


Recap

This was my approach to handling email signatures in Jira. I know its not a clean approach and it has some risks but it is working out very well for my organization. Hopes this helps any of those looking for a solution that doesn't involve additional apps or scripts to process your tickets. You can take this same approach for comments that are added to tickets via email.

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events