Nag,
Please forget color at this time. As i said the color is a GUI indicator that is setup in the preferences.
When you run the autosys job and you look at it .. does it say FAILURE (FA) or does it says SUCCESS (SU)
also as i indicated look at the JIL and make sure they have not used max_exit_success or success_codes.
is this a *nix job or windows job and inside the command .. when it fails does it actually use the code:
exit 1
colors are arbitrary... if its going green then 1 of the following is true:
1.) It is NOT failing due to an issue in the code
2.) It is not failing due to JIL attribute settings
3.) it is failing but the GUI has fail color set to GREEN