I have a sharepoint 2010 portal and have builded a custom workflow in VS2010. In this custom workflow I create a task and sete the title, description and assign it to a user. When this workflow is triggered by a new item, the user receive the mail about this task which is assigned to him. Everything is OK.

In this email there is the description with inside of it a hyperlink to the item in my list. I have implemented this explicit in my custom workflow in codebehind. The strange is, that SharePoint is stripping the domainname from the url in my a href. So for example:

This is my sharepoint domainname:


The hyperlink in the task description is as follow:


The link inside the email after sharepoint has stripped :( the domain name is as follow:


I have googled around and found this blog with the same problem and some workarounds and solutions.


The workaround to use tinyurl is working, but is not the most beautiful. the other solutions I dont understand. Can someone please tell me how to resolve this problem? Maybe you understand the solutions in the blog.

The url: http://test-t.my-domain.com is an intern website. So it is not accessable outside the network of this company.

This is the code which creates the custom task with title, description and assign it:

private void createTaskAssessor_MethodInvoking(object sender, EventArgs e)
            // Now create the approval task.
            SPListItem currentItem = workflowProperties.Item;
            ItemURL = currentItem.ParentList.DefaultDisplayFormUrl + "?ID=" + HttpUtility.UrlEncode(currentItem.ID.ToString());

            ApprovalAssessorTaskId = Guid.NewGuid();
            ApprovalAssessorTaskProperties.Description = string.Format("Er is een nieuw wijzigingsverzoek voor beoordeling <a href=\"{0}\">{1}</a>", GetCurrentItemUrl() + ItemURL, currentItem.Title);
            ApprovalAssessorTaskProperties.Title = string.Format(Constants.Text.TEXT_STATUSCHANGED_ASSESSOR_TITLE, currentItem.Title);
            ApprovalAssessorTaskProperties.AssignedTo = "Beoordelaar";
            ApprovalAssessorTaskProperties.PercentComplete = 0;
            ApprovalAssessorTaskProperties.StartDate = DateTime.Today;
            ApprovalAssessorTaskProperties.DueDate = DateTime.Today;
            ApprovalAssessorTaskProperties.EmailBody = ApprovalAssessorTaskProperties.Description;
            ApprovalAssessorTaskProperties.SendEmailNotification = true;

private string GetCurrentItemUrl()
            SPListItem currentItem = workflowProperties.Item;

            Uri uri = new Uri(workflowProperties.WebUrl);

            string prefix = "http://";
            if (uri.Scheme == Uri.UriSchemeHttps)
                prefix = "https://";

            return prefix + uri.Host;
  • can you post part of the code that is getting the url?
    – Ali Jafer
    Commented Mar 25, 2013 at 11:58

1 Answer 1


try the following:

goto Include a hyperlink to the current item:


someone posted this on the url you provided:

One way around this that I just found is that if you paste the URL and then press backspace at the end and let it clear the hyperlink, the email will still have the Link but it will be full absolute path

  • The first link is not relevant for me, because it is focused on workflows and tasks implementation in sharepoint designer. The second solution is also not relevant for the same reason.
    – Ola
    Commented Mar 25, 2013 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.