Skip to content

Commit

Permalink
Create lastModified.mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmackenzie authored Jun 26, 2024
1 parent 381abd0 commit 81658b0
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions pages/projects/lastModified.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Capture Last Modified Time in Zoho Projects
description: Learn how to create a custom function in Zoho Projects to capture the last modified time of a task.
---

# Capture Last Modified Time in Zoho Projects With a Custom Field

## Function

```javascript
// TODO: Please create a connection for the Zoho Projects service with the scopes "ZohoProjects.tasks.ALL"
// Replace '*********' with the connection name. Click the link below to learn how to create the connection.


timeZone = "Asia/Calcutta";

taskdetails = invokeurl
[
url :"https://projectsapi.zoho.com/restapi/portal/" + portalId + "/projects/" + projectId + "/tasks/" + taskId + "/"
type :get
connection:"*********"
];

modifiedtime = taskdetails.get("tasks").get(0).get("last_updated_time_format");

formatted_date = toString(toDateTime(modifiedtime, "MM-dd-yyyy hh:mm:ss a"), "MM-dd-YYYY HH:mm:ss");

data = Map();
custom_fields = Map();

custom_fields.put("UDF_DATE13", formatted_date);
data.put("custom_fields", custom_fields);

response = invokeurl
[
url :"https://projectsapi.zoho.com/restapi/portal/" + portalId + "/projects/" + projectId + "/tasks/" + taskId + "/"
type :post
parameters: data
connection:"*********"
];

info response;
return "success";

0 comments on commit 81658b0

Please sign in to comment.