I am trying to use above BigFix.me relevance in parameter to generate duration for xml but dont know why its giving relevance error.

Command succeeded parameter "StartDuration"="2 days, 13:02:38"
Command succeeded parameter "EndDuration"="4 days, 13:02:38"
Command failed (Relevance substitution failed) parameter "StartScheduleTime"="{(format "P(0)DT(1)H(2)M(3)S" + it / (1*day) of it + it mod (1*day) / (1*hour) + it mod (1*hour) / (1*minute) + it mod (1*minute) / (1*second) ) of ("(parameter "StartDuration")" as time interval)}"
Command failed (Relevance clauses must be surrounded by { and } guards.) parameter "StartScheduleTime"="{(format "P(0)DT(1)H(2)M(3)S" + it / (1*day) of it + it mod (1*day) / (1*hour) + it mod (1*hour) / (1*minute) + it mod (1*minute) / (1*second) ) of ("(parameter "StartDuration")" as time interval)}"

The syntax of the format command is wrong. It needs curly { and } braces not ( and )

Q: (format "P{0}DT{1}H{2}M{3}S" + it / (1*day) of it + it mod (1*day) / (1*hour) + it mod (1*hour) / (1*minute) + it mod (1*minute) / (1*second) ) of ("2 days, 13:02:38" as time interval)
A: P2DT13H2M38S

You may still have a challenge there though as curly braces within relevance substitution that is defined by the relevance statement within curly bracesâ€¦you may need to escape each } as }} to stop them from being treated as the end of the relevance substitution.

Yes, you are correct ! I placed them for a purpose however I already tested it with escape {{ like below but failed.

Command succeeded parameter "StartDuration"="2 days, 13:02:38"
Command succeeded parameter "EndDuration"="4 days, 13:02:38"
Command failed (Relevance substitution failed) parameter "StartScheduleTime"="{(format "P{{0}DT{{1}H{{2}M{{3}S" + it / (1*day) of it + it mod (1*day) / (1*hour) + it mod (1*hour) / (1*minute) + it mod (1*minute) / (1*second) ) of ((parameter "StartDuration") as time interval)}"
Command failed (Relevance clauses must be surrounded by { and } guards.) parameter "StartScheduleTime"="{(format "P{{0}DT{{1}H{{2}M{{3}S" + it / (1*day) of it + it mod (1*day) / (1*hour) + it mod (1*hour) / (1*minute) + it mod (1*minute) / (1*second) ) of ((parameter "StartDuration") as time interval)}"

yup, tried -
Command succeeded parameter â€śStartDurationâ€ť="2 days, 11:19:00"
Command succeeded parameter â€śEndDurationâ€ť="4 days, 11:19:00"
Command failed (Relevance substitution failed) parameter â€śStartScheduleTimeâ€ť={(( format â€śP{{0}}DT{{1}}H{{2}}M{{3}}Sâ€ť + it / (1day) of it + it mod (1day) / (1hour) + it mod (1hour) / (1minute) + it mod (1minute) / (1*second) ) of ((parameter â€śStartDurationâ€ť) as time interval))}

Might be its not possible to do it with a parameter. Parsing the time interval as a string instead of a parameter seem to work ok but using the same syntax on the parameter values gets an error.

parameter "Test" = "{(format "P{0}}DT{1}}H{2}}M{3}}S" + it / (1*day) of it + it mod (1*day) / (1*hour) + it mod (1*hour) / (1*minute) + it mod (1*minute) / (1*second) ) of ("2 days, 13:02:38" as time interval)}"

parameter "StartDuration"="2 days, 13:02:38"
parameter "EndDuration"="4 days, 13:02:38"
parameter "StartScheduleTime"="{(format "P{0}}DT{1}}H{2}}M{3}}S" + it / (1*day) of it + it mod (1*day) / (1*hour) + it mod (1*hour) / (1*minute) + it mod (1*minute) / (1*second) ) of ((parameter "StartDuration") as time interval)}"

A combination of the quotes but it was mainly the escaping the trailing curly braces on the format command to avoid them ending the relevance substitution