Create a workflow to create enhancements or defects

sjv
Tera Contributor

Hi,

I have been asked to create an intake process through Service catalog which once submitted will create an Enhancement or Defect based on certain conditions.

Is this possible in ServiceNow. I thought you could only create Incidents or Task through the workflow in Servicenow.

Any help would be much appreciated.

Thanks

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Jacob,



You can create any record through a Run Script activity in a workflow. Example:




      var rec = new GlideRecord('any_table');


        rec.newRecord();


      rec.setValue('fieldname', value);


      rec.insert();




Run Script workflow activity


View solution in original post

8 REPLIES 8

Chuck Tomasi
Tera Patron

Hi Jacob,



You can create any record through a Run Script activity in a workflow. Example:




      var rec = new GlideRecord('any_table');


        rec.newRecord();


      rec.setValue('fieldname', value);


      rec.insert();




Run Script workflow activity


sjv
Tera Contributor

Hi Chuck,



Thanks for the quick answer. So when I create my workflow, what would be the table that the workflow will access. Would it be the Task table. Also do you have any examples of the above.



Thanks


Hi Jacob,



When you mentioned the Service Catalog, are you looking to create a catalog item or a record producer? That's going to determine what table you use in your workflow. If you use a catalog item, then you workflow runs against Requested Item (sc_req_item). If you use a record producer, then it runs against the same table your record producer does to create that record.



Since it sounds like you want a workflow BEFORE you create the enhancement or defect, then a catalog item is not likely the right answer since the record producer immediately creates the record for which it is running on (e.x if you make a record producer on the enhancement table, then it's going to create an enhancement right away.) This MAY be what you want... I don't know enough about your process. Your enhancement is likely to have a life cycle of it's own. Does it make sense to have someone "order" an enhancement request like they would a laptop only to have it go through an approval and create the enhancement request, then that goes through it's own life cycle?



Sorry to so sound confused on such a simple question, but it opens up more questions as to what is really needed here. What is the process? What is the expected user experience? How many tables/forms/records/approvals do you need to touch? That all needs to be looked at before proposing a technical solution.



Thanks.


sjv
Tera Contributor

Thanks Chuck,



So the requirement is that we create a Service Catalog item with fields that will capture the requirements for say a report.


Once the submit button has been pressed, the re will be logic built in to identify whether it is a defect or an enhancement. I have not though about this yet. . Once it has been identified that it is a defect or an enhancement, the workflow should create an enhancement or defect automatically.



My suggestion was



That we could create an incident from the service catalog, and assign it to a specific group or person. That person could then right click and create a defect or an enhancement and close the incident.



I am trying to see whether the user original request is even doable.



Thanks