@requires_swimlane_version('<STR_LIT>')<EOL><INDENT>def bulk_modify(self, *filters_or_records, **kwargs):<DEDENT>
values = kwargs.pop('<STR_LIT>', None)<EOL>if kwargs:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(kwargs))<EOL><DEDENT>if not values:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if not isinstance(values, dict):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>_type = validate_filters_or_records(filters_or_records)<EOL>request_payload = {}<EOL>record_stub = record_factory(self._app)<EOL>if _type is Record:<EOL><INDENT>request_payload['<STR_LIT>'] = [record.id for record in filters_or_records]<EOL><DEDENT>else:<EOL><INDENT>filters = []<EOL>for filter_tuples in filters_or_records:<EOL><INDENT>field_name = record_stub.get_field(filter_tuples[<NUM_LIT:0>])<EOL>filters.append({<EOL>"<STR_LIT>": field_name.id,<EOL>"<STR_LIT>": filter_tuples[<NUM_LIT:1>],<EOL>"<STR_LIT:value>": field_name.get_report(filter_tuples[<NUM_LIT:2>])<EOL>})<EOL><DEDENT>request_payload['<STR_LIT>'] = filters<EOL><DEDENT>for field_name in list(values.keys()):<EOL><INDENT>modification_operation = values[field_name]<EOL>if not isinstance(modification_operation, _BulkModificationOperation):<EOL><INDENT>values[field_name] = Replace(modification_operation)<EOL><DEDENT><DEDENT>modifications = []<EOL>for field_name, modification_operation in values.items():<EOL><INDENT>modification_field = record_stub.get_field(field_name)<EOL>if not modification_field.bulk_modify_support:<EOL><INDENT>raise ValueError("<STR_LIT>".format(<EOL>field_name,<EOL>modification_field.__class__.__name__<EOL>))<EOL><DEDENT>modifications.append({<EOL>"<STR_LIT>": {<EOL>"<STR_LIT:value>": modification_field.id,<EOL>"<STR_LIT:type>": "<STR_LIT:id>"<EOL>},<EOL>"<STR_LIT:value>": modification_field.get_bulk_modify(modification_operation.value),<EOL>"<STR_LIT:type>": modification_operation.type<EOL>})<EOL><DEDENT>request_payload['<STR_LIT>'] = modifications<EOL>response = self._swimlane.request('<STR_LIT>', "<STR_LIT>".format(self._app.id), json=request_payload)<EOL>if _type is Record:<EOL><INDENT>for record in filters_or_records:<EOL><INDENT>for field_name, modification_operation in six.iteritems(values):<EOL><INDENT>record[field_name] = modification_operation.value<EOL><DEDENT><DEDENT><DEDENT>return response.text<EOL>
Shortcut to bulk modify records

        .. versionadded:: 2.17.0

        Args:
            *filters_or_records (tuple) or (Record): Either a list of Records, or a list of filters.

        Keyword Args:
            values (dict): Dictionary of one or more 'field_name': 'new_value' pairs to update

        Notes:
            Requires Swimlane 2.17+

        Examples:

            ::

                # Bulk update records by filter

                app.records.bulk_modify(
                    # Query filters
                    ('Field_1', 'equals', value1),
                    ('Field_2', 'equals', value2),
                    ...
                    # New values for records
                    values={
                        "Field_3": value3,
                        "Field_4": value4,
                        ...
                    }
                )

                # Bulk update records

                record1 = app.records.get(tracking_id='APP-1')
                record2 = app.records.get(tracking_id='APP-2')
                record3 = app.records.get(tracking_id='APP-3')

                app.records.bulk_modify(record1, record2, record3, values={"Field_Name": 'new value'})

        Returns:
            :class:`string`: Bulk Modify Job ID