I'm glad if it worked for you. If you need anything else, let me know and I will be happy to help you.
ARSAT S.A. - Actively seeking employment
Original Message:
Sent: 07-28-2024 20:23
From: Darwin Bagangan
Subject: Automation script - Please Help
HI Martin,
Thanks thanks thanks. This really works for me.
What Im trying to achieve is to put this script-field on dashboard and use it in result set like in picture below.

------------------------------
Darwin Bagangan
GNPOWER
Original Message:
Sent: 07-26-2024 09:56
From: Martin Fabra
Subject: Automation script - Please Help
Darwin,
If you want to save the current year only when you create a new SR, this jython script on SR OBJECT solves it:
# Script: set_current_year_on_create.py
# Descripción: Save current year on field "CURR_YEAR" when you create a new SR
from psdi.server import MXServer
from java.util import Calendar
# Get current year
current_year = Calendar.getInstance().get(Calendar.YEAR)
# Set the value of the persistent field
mbo.setValue("CURR_YEAR", current_year)

Then I will try to pass you the other one, when the SR object is modified.
Regards!
------------------------------
Martin Fabra
ARSAT S.A. - Actively seeking employment
Original Message:
Sent: 07-25-2024 22:53
From: Darwin Bagangan
Subject: Automation script - Please Help
Appreciate any input from you guys:
I created a new persistent date attribute in ticket object named srdate and i want to populate that field with YEAR only for every transaction in our service request application.
Can anyone guide me on how to do it?
Thanks and keep safe everyone.
#Administration
------------------------------
Darwin Bagangan
GNPOWER
------------------------------