How to update fields in ServiceNow which are being updated in Jira via BR?

ujjwala_678
Tera Contributor

Hello Experts,

I have a business rule in my instance which is updating the date/time fields based on state level change done on the issue record. With that , jira integration is in place which has been linked to the issue table. 
My concern is whenever state change is happening on form level , BR is working fine and showing date/time field values, but when fields are getting updated in jira , the BR is not running and not showing data for date/time fields.

I need to figure out if there's any way I can have the fields updated when the state gets changed in jira not within service-now instance ?

All suggestions are welcome.

Thank you.

1 ACCEPTED SOLUTION

KevinBellardine
Kilo Sage

Hey Ujjwala,

I'd need a bit more information before I could tell you what's happening here. What I'll say is that Business Rules are evaluated every time the database is queried or modified with few exceptions. I can see two ways this could be happening for you.

1. The Business Rule you've written isn't being triggered. Check the conditions, both in the conditions tab and the conditions line on the advanced tab.

 

2. The integration from Jira is running with Business Rules turned off. If it's an import check the transform map and see if 'run business rules' has been checked.

View solution in original post

3 REPLIES 3

KevinBellardine
Kilo Sage

Hey Ujjwala,

I'd need a bit more information before I could tell you what's happening here. What I'll say is that Business Rules are evaluated every time the database is queried or modified with few exceptions. I can see two ways this could be happening for you.

1. The Business Rule you've written isn't being triggered. Check the conditions, both in the conditions tab and the conditions line on the advanced tab.

 

2. The integration from Jira is running with Business Rules turned off. If it's an import check the transform map and see if 'run business rules' has been checked.

Hi Kevin, Good day!

Thank you for replying. So far the condition for onbefore Business rule is set as state changes.

with the below script-

(function executeRule(current, previous /*null when async*/ ) {

// Add your code here
var newState = current.state;
if (newState == 1) { //State is Draft
current.u_date_time_issue_moved_to_draft = new GlideDateTime();
} else if (newState == 2) { //State is Analyze
current.u_date_time_issue_analyze = new GlideDateTime();
} else if (newState == 5) { //State is Respond
current.u_date_time_issue_response = new GlideDateTime();
} else if (newState == 0) { //State is Validate
current.u_date_time_issue_validate = new GlideDateTime();
} else if (newState == 7) { //State is Cancelled
current.u_date_time_issue_moved_to_cancelled = new GlideDateTime();
} else if (newState == 6) { //State is Deferred
current.u_date_time_issue_deferred = new GlideDateTime();
}
//current.update();

})(current, previous);
 
 
Let me know your thoughts if should make any changes over here.
Thank you again.

Mathieu Lepoutr
Mega Guru

Hi

 

Please ensure that the BR is set to run After the record is inserted or updated. Additionally, ensure that the "Run Business Rule" condition is set to "when a record is inserted or updated by a web service" since the Jira update might be coming in as a web service call.

 

Its my understanding that Exalate would be perfect for a use-case like this. It's a decentralized integration solution which provides robust syncronization capabilities and you can granuarly decided what you want to send to the other side and how you want to apply receiving information. I have been using it for quite a while and it instantly jumped in my thoughts reading this post.