---
original_url: "https://jace.pro/blog/creating-actionable-email-links/"
format: markdown
ai_optimized: true
---

Creating actionable email links# Creating actionable email links

July 3, 2018 [servicenow ](/tags/servicenow/)[email](/tags/email/)

  Enable AI AnimationThe other day [Chris Perry asked](https://community.servicenow.com/community?id=community_question&sys_id=37113a00dbc39704d58ea345ca9619e8) how to create a link in a notification to assign a record to themselves and load up the newly assigned record.

To do this you’d have change your email to the user, so show the link and then load a page that knew the task and have it redirect. This is what I came up with. A UI page with the following code does it.

`<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
  <g2:evaluate var="jvar_unwrapped_url" jelly="true">
    var currentUser = gs.getUserID();
    var incidentFromURL = RP.getParameterValue('incident');
    var link = '';
    var incident = new GlideRecord('incident');
    if(incident.get('number', incidentFromURL)) {
      incident.setValue('assigned_to', currentUser);
      incident.update();
      gs.addInfoMessage(incident.getDisplayValue() + ' has been updated.');
      //gs.sendRedirect(incident.getLink());
      link = incident.getLink();
    }
    link || 'incident.do?sysparm_query=number=' + incidentFromURL;
  </g2:evaluate>
  ${gs.getMessage("Redirecting to your the incident")}...
</j:jelly>`## [Client Script](#client-script)

```
`document.location.href = "$[JS:jvar_unwrapped_url]";`
```

---
[View this page on GitHub](https://github.com/jacebenson/jace.pro/tree/main/./src/posts/2018/2018-07-03-creating-actionable-email-links.md).

[Creating actionable email links](https://jace.pro/blog/creating-actionable-email-links/) [Jace Benson](https://jace.pro) ![Jace Benson](https://jace.pro/icon-512x512.png)

---

*This content is from Jace Benson's ServiceNow and tech blog at jace.pro*
*Original post: https://jace.pro/blog/creating-actionable-email-links/*
