cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Is it possible to add Change Request Number in the email notification?

RG_10753677
10-Marble

Is it possible to add Change Request Number in the email notification?

Objective:  Change Request/Change Notice Number and description attributes in the Workflow Notification Email.
In the workflow template, Is there a way to add Change Request Description/Number as variables ?

RG_10753677_3-1691699811397.png

 

RG_10753677_1-1691699451779.png

 

Currently, the email looks like this 
RG_10753677_4-1691699985709.png


But, I'm looking for something like this with Change Request/Notice attributes in the bottom.

RG_10753677_2-1691699573247.png

 

 

 

ACCEPTED SOLUTION

Accepted Solutions
avillanueva
22-Sapphire II
(To:RG_10753677)

https://support.ptc.com/help/windchill/r13.0.0.0/en/?_gl=1*1xirda6*_ga*MjA1NjM1MzcyNS4xNjc4OTUwMDM0*_ga_1QBT6P6HR1*MTY5MTQxMTAwMy4zMzAuMS4xNjkxNDEzMDM1LjAuMC4w*_ga_CBN5QVB9VJ*MTY5MTQxMTYwNi4yMTEuMS4xNjkxNDEzMDM1LjAuMC4w#page/Windchill_Help_Center/customization/WCCG_BusLogicCust_WorkflowAdmin_EmailNo...

Documentation is above. You need to customize the codebase/templates/General*.html files like below. This is mine to show the PBO name and number. The pboNumber is a workflow variable so you can call those out too. This modifies the email subject as it appears.

 

<html>
<!-- bcwti
  --
  -- Copyright (c) 1997, 1998 Windchill Technology, Inc.  All Rights Reserved.
  --
  -- This software is the confidential and proprietary information of
  -- Windchill Technology.  You shall not disclose such confidential information
  -- and shall use it only in accordance with the terms of the license
  -- agreement you entered into with Windchill Technology.
  --
  -- ecwti
  -->
<SCRIPT LANGUAGE=Windchill> <!-- beginSubject --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- getActivityName --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- addText text=" - " --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- getProcessVariable varName="pboNumber" --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- addText text=" - " --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- getPrimaryBusinessObjectName --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- endSubject --> </SCRIPT>  
<head>
     <SCRIPT LANGUAGE=Windchill>
        <!--
          getStyleSheetProps
        -->
   </SCRIPT>
</head>

<body>

<font face="Arial, Helvetica, sans-serif">
<SCRIPT LANGUAGE=Windchill> activityNotificationUrl </SCRIPT>
</font>

<SCRIPT LANGUAGE=Windchill>
<!--
   activityAttributes notification=true
-->
</SCRIPT>

</body>
</html>

Next I modified the task Instructions to include data which would appear in the subject of the email:

avillanueva_0-1691753614752.png

The final result is like this:

avillanueva_1-1691753725435.png

 

 

View solution in original post

6 REPLIES 6
avillanueva
22-Sapphire II
(To:RG_10753677)

Yes, I’ve done this. I can post instructions.

Sent from my iPhone
avillanueva
22-Sapphire II
(To:RG_10753677)

https://support.ptc.com/help/windchill/r13.0.0.0/en/?_gl=1*1xirda6*_ga*MjA1NjM1MzcyNS4xNjc4OTUwMDM0*_ga_1QBT6P6HR1*MTY5MTQxMTAwMy4zMzAuMS4xNjkxNDEzMDM1LjAuMC4w*_ga_CBN5QVB9VJ*MTY5MTQxMTYwNi4yMTEuMS4xNjkxNDEzMDM1LjAuMC4w#page/Windchill_Help_Center/customization/WCCG_BusLogicCust_WorkflowAdmin_EmailNo...

Documentation is above. You need to customize the codebase/templates/General*.html files like below. This is mine to show the PBO name and number. The pboNumber is a workflow variable so you can call those out too. This modifies the email subject as it appears.

 

<html>
<!-- bcwti
  --
  -- Copyright (c) 1997, 1998 Windchill Technology, Inc.  All Rights Reserved.
  --
  -- This software is the confidential and proprietary information of
  -- Windchill Technology.  You shall not disclose such confidential information
  -- and shall use it only in accordance with the terms of the license
  -- agreement you entered into with Windchill Technology.
  --
  -- ecwti
  -->
<SCRIPT LANGUAGE=Windchill> <!-- beginSubject --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- getActivityName --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- addText text=" - " --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- getProcessVariable varName="pboNumber" --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- addText text=" - " --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- getPrimaryBusinessObjectName --> </SCRIPT>
<SCRIPT LANGUAGE=Windchill> <!-- endSubject --> </SCRIPT>  
<head>
     <SCRIPT LANGUAGE=Windchill>
        <!--
          getStyleSheetProps
        -->
   </SCRIPT>
</head>

<body>

<font face="Arial, Helvetica, sans-serif">
<SCRIPT LANGUAGE=Windchill> activityNotificationUrl </SCRIPT>
</font>

<SCRIPT LANGUAGE=Windchill>
<!--
   activityAttributes notification=true
-->
</SCRIPT>

</body>
</html>

Next I modified the task Instructions to include data which would appear in the subject of the email:

avillanueva_0-1691753614752.png

The final result is like this:

avillanueva_1-1691753725435.png

 

 

I've updated General, General_en_GN, General_en_US html files.

 

RG_10753677_0-1692210767568.png

 


But since the template in my workflow is NotificationRobot template, I am wondering if I should change the NotificationRobot html files instead of General.* html files.

RG_10753677_1-1692210767579.png

 

Next, Does the variable need to show up in the dropdown for it to work?

 

RG_10753677_2-1692210767513.png

 

 

This is the output so far. My email notification has {pboNumber} and {pboDescription} variable names instead of their values. Please let me know if I'm missing something.

RG_10753677_3-1692210767566.png

 

 

Hi @RG_10753677 

Sure you need to update the correct html template. So if you use notification robot you need to update that one. 

 

If the variables do not exist then it will not be shown in the email. 

You need to create the variables in the workflow and fill up with correct values by code.

 

PetrH

pboNumber and pboDescription are already existing variables. Can you guide me how/where do I create them? TIA

Hi @RG_10753677 

If the variables exist why do you ask how to create it?

 

I guess that you just want to fill them with values as you need. 

 

It depends what is the primaryObject in the workflow. is it change request? notice? task? or something else?

 

for change  notice here is example

 

 

wt.change2.WTChangeOrder2 changeOrder = (wt.change2.WTChangeOrder2)primaryBusinessObject; 
pboNumber = changeOrder.getNumber();

 

 

pboNumber has to exist as a variable and type string.

 

You need to just add the code to a expression robot of the workflow

 

the example can be used for any type of object. You just need to change the object type. 

 

an another example from changeTask

 

wt.change2.WTChangeActivity2 thisActivity= (wt.change2.WTChangeActivity2)primaryBusinessObject;
com.ptc.core.lwc.server.PersistableAdapter obj = new com.ptc.core.lwc.server.PersistableAdapter(thisActivity,null,null,null);

obj.load("name","number");
pboNumber = obj.get("number").toString();
pboName = obj.get("name").toString();

 

PetrH

Announcements


Top Tags