Following great advice from Robert Paulsen I have created simple solution to achieve this.
I have also used some code from this location to convert string to unique identifier. It was posted by Scott Pletcher. There is a function to get this uid from string.
http://www.sqlservercentral.com/Forums/FindPost1480606.aspx
Example code can look like this. There is a need for more checks as the code will not work if is not run by SQL Agent.
--Get Program Name
DECLARE @ProgramName VARCHAR(255)
DECLARE @StartOfJjobId INT
DECLARE @JobIdPrefix VARCHAR(30) = '(Job 0x'
SET @ProgramName = (SELECT Program_name FROM sys.dm_exec_sessions WHERE session_Id = @@SPID)
--If run by job it will returns something like this line below
--SQLAgent - TSQL JobStep (Job 0x5A9C063C3BDE5D41B4CBF86D4C1A82A5 Step 1)
SET @StartOfJjobId = CHARINDEX(@JobIdPrefix, @ProgramName) + LEN(@JobIdPrefix)
select name AS JobName from msdb..sysjobs where job_id = (SELECT CAST(
SUBSTRING(@ProgramName, @StartOfJjobId + 06, 2) + SUBSTRING(@ProgramName, @StartOfJjobId + 04, 2) +
SUBSTRING(@ProgramName, @StartOfJjobId + 02, 2) + SUBSTRING(@ProgramName, @StartOfJjobId + 00, 2) + '-' +
SUBSTRING(@ProgramName, @StartOfJjobId + 10, 2) + SUBSTRING(@ProgramName, @StartOfJjobId + 08, 2) + '-' +
SUBSTRING(@ProgramName, @StartOfJjobId + 14, 2) + SUBSTRING(@ProgramName, @StartOfJjobId + 12, 2) + '-' +
SUBSTRING(@ProgramName, @StartOfJjobId + 16, 4) + '-' +
SUBSTRING(@ProgramName, @StartOfJjobId + 20,12) AS uniqueidentifier))